Code example for AlertDialog

Methods: show

0
			invalidLaunchAlert = new AlertDialog.Builder(this)
				.setTitle(title)
				.setMessage(message)
				.setPositiveButton(buttonText, restartListener)
				.setCancelable(false).create();
			invalidLaunchAlert.show();
		} 
	} 
 
	protected void restartActivity(int delay)
	{ 
		restartActivity(delay, 0);
	} 
 
	protected void restartActivity(int delay, int finishDelay)
	{ 
		Intent relaunch = new Intent(getApplicationContext(), getClass());
		relaunch.setAction(Intent.ACTION_MAIN);
		relaunch.addCategory(Intent.CATEGORY_LAUNCHER);
 
		restartAlarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);