ユーザーがバックアップデータベースを上書きするときにダイアログをポップアップしようとしているので、このコードを記述しましたが、機能しませんでした。
$if(backupDB.exists()){
AlertDialog.Builder builder = new AlertDialog.Builder(getBaseContext());
builder.setTitle("Backup database...");
builder.setMessage("You have already backup the database, do you want to overwrite?");
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Intent i=new Intent(getBaseContext(),FinancialSecretary.class);
finish();
startActivity(i);
}
});
AlertDialog dialog = builder.create();
}
何が悪いの?