private void processExtraData(Map<String, String> extraData, final Runnable postRunnable) { if (extraData != null && !extraData.isEmpty()) { PackageUtil.runInstallPluginDialog(myActivity, extraData, postRunnable); } else { postRunnable.run(); } }
public static void runRegistrationDialog(Activity activity, INetworkLink link) { try { final Intent intent = registrationIntent(link); if (PackageUtil.canBeStarted(activity, intent, true)) { activity.startActivity(intent); } } catch (ActivityNotFoundException e) { } }
public static void installDictionaryIfNotInstalled(final Activity activity) { if (PackageUtil.canBeStarted(activity, getDictionaryIntent("test"))) { return; } final ZLResource dialogResource = ZLResource.resource("dialog"); final ZLResource buttonResource = dialogResource.getResource("button"); final ZLResource installResource = dialogResource.getResource("installDictionary"); new AlertDialog.Builder(activity) .setTitle(installResource.getResource("title").getValue()) .setMessage(installResource.getResource("message").getValue().replace("%s", "ColorDict")) .setIcon(0) .setPositiveButton( buttonResource.getResource("install").getValue(), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { installDictionary(activity); } }) .setNegativeButton(buttonResource.getResource("skip").getValue(), null) .create() .show(); }
private static void installDictionary(Activity activity) { if (!PackageUtil.installFromMarket(activity, "com.socialnmobile.colordict")) { UIUtil.showErrorMessage(activity, "cannotRunAndroidMarket", "ColorDict"); } }
public static boolean isRegistrationSupported(Activity activity, INetworkLink link) { return PackageUtil.canBeStarted(activity, registrationIntent(link), true); }