コード例 #1
0
ファイル: OpenCatalogAction.java プロジェクト: 04k/FBReaderJ
 private void processExtraData(Map<String, String> extraData, final Runnable postRunnable) {
   if (extraData != null && !extraData.isEmpty()) {
     PackageUtil.runInstallPluginDialog(myActivity, extraData, postRunnable);
   } else {
     postRunnable.run();
   }
 }
コード例 #2
0
 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) {
   }
 }
コード例 #3
0
  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();
  }
コード例 #4
0
 private static void installDictionary(Activity activity) {
   if (!PackageUtil.installFromMarket(activity, "com.socialnmobile.colordict")) {
     UIUtil.showErrorMessage(activity, "cannotRunAndroidMarket", "ColorDict");
   }
 }
コード例 #5
0
 public static boolean isRegistrationSupported(Activity activity, INetworkLink link) {
   return PackageUtil.canBeStarted(activity, registrationIntent(link), true);
 }