AlertDialog dialog = new AlertDialog.Builder(activity).setTitle("选择新任务")
.setPositiveButton("选择新任务", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
WorkspaceActivity.slideToTab(1);
}
}).create();
dialog.show();
------解决方案--------------------
- Java code
AlertDialog dialog = new AlertDialog.Builder(activity).setTitle("选择新任务") .setPositiveButton("选择新任务", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { WorkspaceActivity.slideToTab(1);dialog.cancel(); } }).create(); dialog.show();