Code example for Dialog

Methods: findViewById

0
 
	@Override 
	protected void onPrepareDialog(int id, Dialog dialog) {
		super.onPrepareDialog(id, dialog);
		if (id >= DIALOG_INFO && id < DIALOG_GET_FROM_MARKET) {
			dialog.findViewById(android.R.id.button1).setVisibility(View.GONE);
		} else if (id >= DIALOG_GET_FROM_MARKET && id < DIALOG_DISTRIBUTION_START){
			DownloadAppDialog.onPrepareDialog(this, dialog);
		} 
		 
	} 
 
	private AlertDialog buildInfoDialog(final int pos) {
		String infotext = getString(mInfoText[pos], mApplicationStrings[pos]);
		String infolaunch = getString(R.string.oi_distribution_info_launch, mApplicationStrings[pos]);
		 
		// Trick for Android 2.3: 
		// To achieve the visual trick of extending the button over the whole width, 
		// we first set a positive button, and then set its visibility to GONE in  
		// onPrepareDialog().