質問編集履歴

1

追記

2015/11/20 04:28

投稿

aaaaaaaaaaaaaa
aaaaaaaaaaaaaa

スコア77

test CHANGED
File without changes
test CHANGED
@@ -65,3 +65,71 @@
65
65
 
66
66
 
67
67
  </LinearLayout>
68
+
69
+
70
+
71
+ ダイアログ作成部分
72
+
73
+ @Override
74
+
75
+ protected Dialog onCreateDialog(int id) {
76
+
77
+ switch (id) {
78
+
79
+
80
+
81
+ case CUSTOM_DIALOG:
82
+
83
+
84
+
85
+ //レイアウトの呼び出し
86
+
87
+ LayoutInflater factory = LayoutInflater.from(this);
88
+
89
+ final View inputView = factory.inflate(R.layout.input_dialog, null);
90
+
91
+
92
+
93
+ //ダイアログの作成(AlertDialog.Builder)
94
+
95
+ return new AlertDialog.Builder(customDialogActivity.this)
96
+
97
+ .setIcon(android.R.drawable.ic_dialog_alert)
98
+
99
+ .setTitle(R.string.dialog_name)
100
+
101
+ .setView(inputView)
102
+
103
+ .setPositiveButton("OK", new DialogInterface.OnClickListener() {
104
+
105
+ public void onClick(DialogInterface dialog, int whichButton) {
106
+
107
+
108
+
109
+ /* int whichButton により、押されたボタンを判定 */
110
+
111
+ /* 受付処理 :入力されたテキストの処理など */
112
+
113
+ }
114
+
115
+ })
116
+
117
+ .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
118
+
119
+ public void onClick(DialogInterface dialog, int whichButton) {
120
+
121
+ /* キャンセル処理 */
122
+
123
+ }
124
+
125
+ })
126
+
127
+ .create();
128
+
129
+ }
130
+
131
+
132
+
133
+ return null;
134
+
135
+ }