Code example for Dialog

Methods: findViewById

0
	public static void onPrepareDialog(Context context, Dialog dialog) {
		DownloadAppDialog d = (DownloadAppDialog) dialog;
		 
		boolean has_android_market = MarketUtils.isMarketAvailable(context, d.mDownloadPackageName);
 
		dialog.findViewById(android.R.id.button1).setVisibility(
				has_android_market ? View.VISIBLE : View.GONE);
	} 
	 
	/** 
	 * Start an activity but prompt a toast if activity is not found 
	 * (instead of crashing). 
	 *  
	 * @param context 
	 * @param intent 
	 */ 
	public void startSaveActivity(Intent intent) {
		try { 
			mContext.startActivity(intent);
		} catch (ActivityNotFoundException e) {
			Toast.makeText(mContext,