メインアクティビティ内に2つのタブがあるタブホストがあります。2番目のタブには、コンテンツとしてリストビューインテントを追加しました。すべてが正常に機能しています。onCreateDialog()
リストビュー(2番目のタブ)でメソッドをオーバーライドしました。showDialog(MY_DIALOG);
メソッドを呼び出すと呼び出されonCreateDialog()
ますが、LogCatで次のような警告が表示されます。
"WARN/InputManagerService(58): Window already focused, ignoring
focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44ee6948"
tabhostのアクティビティ内にダイアログボックスを表示する方法を教えてもらえますか。
//編集
protected Dialog onCreateDialog(int id) {
Log.v(Constants.LOGTAG, " " +CLASSTAG+ " onCreateDialog(): +++ START +++");
AlertDialog.Builder builder = new AlertDialog.Builder(this);
switch (id) {
case DIALOG_MY_TYPES: {
Log.v(Constants.LOGTAG, " " +CLASSTAG+ " onCreateDialog(): DIALOG_MY_TYPES");
CharSequence[] items = {"option1", "option2", "option3"};
builder.setTitle("Select").setItems(items,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Log.d(CLASSTAG, "item selected = " + item);
dialog.cancel();
}
}).setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Log.d(Constants.LOGTAG, " "+CLASSTAG+" Cancel button is clicked");
dialog.cancel();
}
});
}
}//switch
alert = builder.create();
Log.v(Constants.LOGTAG, " " +CLASSTAG+ " onCreateDialog(): +++ END +++");
return super.onCreateDialog(id);
}
前もって感謝します。-ネハサ