jjzjj

DialogInterface

全部标签

android - 覆盖对话框 onBackPressed()?

如何覆盖Dialog的onBackPressed以关闭对话框以及在Activity上调用finish()它位于? 最佳答案 您可以使用setOnCancelListener:dialog.setOnCancelListener(newDialogInterface.OnCancelListener(){@OverridepublicvoidonCancel(DialogInterfacedialog){MyActivity.this.finish();}});您只需完成您的Activity。对话框将自动关闭。

android - 覆盖对话框 onBackPressed()?

如何覆盖Dialog的onBackPressed以关闭对话框以及在Activity上调用finish()它位于? 最佳答案 您可以使用setOnCancelListener:dialog.setOnCancelListener(newDialogInterface.OnCancelListener(){@OverridepublicvoidonCancel(DialogInterfacedialog){MyActivity.this.finish();}});您只需完成您的Activity。对话框将自动关闭。

android - setImeOptions : why the "Done" button does not show on the soft keyboard?

我尝试使用input.setImeOptions(EditorInfo.IME_ACTION_DONE)设置软键盘上的“完成”按钮;但“完成”按钮根本不显示在软键盘上。有什么建议吗?publicvoidmodif(intposition){AlertDialog.Builderalert=newAlertDialog.Builder(MainActivity.this);alert.setTitle("Modifica");EditTextinput=newEditText(MainActivity.this);input.setImeOptions(EditorInfo.IME_AC

android - setImeOptions : why the "Done" button does not show on the soft keyboard?

我尝试使用input.setImeOptions(EditorInfo.IME_ACTION_DONE)设置软键盘上的“完成”按钮;但“完成”按钮根本不显示在软键盘上。有什么建议吗?publicvoidmodif(intposition){AlertDialog.Builderalert=newAlertDialog.Builder(MainActivity.this);alert.setTitle("Modifica");EditTextinput=newEditText(MainActivity.this);input.setImeOptions(EditorInfo.IME_AC

android - 如何完成一个android应用程序?

我需要完成一个安卓应用程序。为此我写了@OverridepublicvoidonBackPressed(){AlertDialog.Builderbuilder=newAlertDialog.Builder(this);builder.setMessage("AreyousureYouwanttoexit").setCancelable(false).setPositiveButton("YES"),newDialogInterface.OnClickListener(){//On//clicking//"Yes"//buttonpublicvoidonClick(DialogInte

android - 如何完成一个android应用程序?

我需要完成一个安卓应用程序。为此我写了@OverridepublicvoidonBackPressed(){AlertDialog.Builderbuilder=newAlertDialog.Builder(this);builder.setMessage("AreyousureYouwanttoexit").setCancelable(false).setPositiveButton("YES"),newDialogInterface.OnClickListener(){//On//clicking//"Yes"//buttonpublicvoidonClick(DialogInte

android - 带有长文本的对话框按钮不换行/挤压 - android 5.0 lollipop 上的 Material 主题

在优化LollipopMaterial主题的应用时,我遇到了这个烦人的问题:当对话框按钮上的长文本不适合按钮栏的总宽度时,这些按钮的文本不会像以前的主题中那样包含在多行中。相反,以下按钮被挤出对话框,无法访问(见下图)。截图:到目前为止,我已经在这个问题上花费了很多时间,我可以在互联网上找到的唯一主题是:https://code.google.com/p/android/issues/detail?id=78302所以我接受那里的建议并在这里问这个问题..我尝试查看源代码(按钮使用maxLines=2定义)并更改buttonBarStyle和buttonBarButtonStyle上的

android - 带有长文本的对话框按钮不换行/挤压 - android 5.0 lollipop 上的 Material 主题

在优化LollipopMaterial主题的应用时,我遇到了这个烦人的问题:当对话框按钮上的长文本不适合按钮栏的总宽度时,这些按钮的文本不会像以前的主题中那样包含在多行中。相反,以下按钮被挤出对话框,无法访问(见下图)。截图:到目前为止,我已经在这个问题上花费了很多时间,我可以在互联网上找到的唯一主题是:https://code.google.com/p/android/issues/detail?id=78302所以我接受那里的建议并在这里问这个问题..我尝试查看源代码(按钮使用maxLines=2定义)并更改buttonBarStyle和buttonBarButtonStyle上的

android - IllegalStateException( "You can not set Dialog' s OnCancelListener 或 OnDismissListener")

此DialogFragment实现会导致IllegalStateException("YoucannotsetDialog'sOnCancelListenerorOnDismissListener")。为什么?解决方案?publicclassOkCThreadDialog1extendsDialogFragment{DialogInterface.OnCancelListeneronCancelListener;publicOkCThreadDialog1(){}publicstaticOkCThreadDialog1newInstance(Stringtitle,Stringmess

android - IllegalStateException( "You can not set Dialog' s OnCancelListener 或 OnDismissListener")

此DialogFragment实现会导致IllegalStateException("YoucannotsetDialog'sOnCancelListenerorOnDismissListener")。为什么?解决方案?publicclassOkCThreadDialog1extendsDialogFragment{DialogInterface.OnCancelListeneronCancelListener;publicOkCThreadDialog1(){}publicstaticOkCThreadDialog1newInstance(Stringtitle,Stringmess