Here is my code . and now how to click on POSITIVE button automatically in alert dialog button.
static void show(final Context context, String content, final String downloadUrl) {
if (isContextValid(context)) {
new AlertDialog.Builder(context)
.setIcon(R.drawable.ic_support)
.setTitle(R.string.android_auto_update_dialog_title)
.setMessage(content)
.setPositiveButton(R.string.android_auto_update_dialog_btn_download, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
goToDownload(context, downloadUrl);
}
})
.setCancelable(false)
.show();
}
}