Code example for AtomicBoolean

Methods: getAndSet

0
	ProgressBar progressBar = null;	
	private static ProgressDialog progressDialog = null;
	private static AtomicBoolean isshowing = new AtomicBoolean(false);
	public static void showInfiniteProgressDialoge(final Activity underlying_activity,final String title,final String message)
	{ 
		if(!isshowing.getAndSet(true))
		{ 
			Platform.getInstance().getHandler().post((new Runnable(){
				public void run() {						 
					progressDialog = ProgressDialog.show(underlying_activity, title, message, true);	
					progressDialog.setCancelable(true);
				}})); 
		} 
		else 
		{ 
			if(progressDialog!=null)
			{ 
				progressDialog.setTitle(title);
				progressDialog.setMessage(message);
			} 
		}