Code example for Activity

Methods: runOnUiThread

0
	} 
 
	public static void runWithMessage(final Activity activity, String key, final Runnable action, final Runnable postAction, final boolean minPriority) {
		final String message =
			ZLResource.resource("dialog").getResource("waitMessage").getResource(key).getValue();
		activity.runOnUiThread(new Runnable() {
			public void run() { 
				final ProgressDialog progress = ProgressDialog.show(activity, null, message, true, false);
 
				final Thread runner = new Thread() {
					public void run() { 
						action.run();
						activity.runOnUiThread(new Runnable() {
							public void run() { 
								try { 
									progress.dismiss();
								} catch (Exception e) {
									e.printStackTrace();
								} 
								if (postAction != null) {
									postAction.run();