d-m*_*man 9 android dialog android-activity
我想在弹出屏幕中启动一个活动.有任何快速变化的建议吗?
new AlertDialog.Builder(SearchResults.this)
.setTitle("Refine")
.setItems(/*catNames*/, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
/* User clicked so do some stuff */
String catName = catNames[which];
String categoryIds = subCats.get(catName);
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
//do nothing just dispose
}
})
.create().show();
Run Code Online (Sandbox Code Playgroud)
Jam*_*mes 22
您还可以应用此主题,以便您的活动显示为对话框:
<activity android:theme="@android:style/Theme.Dialog">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13018 次 |
| 最近记录: |