public void startChrome(Uri uri) {
   Intent it = new Intent(Intent.ACTION_VIEW);
   it.setData(uri);
   it.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
   it.setClassName("com.android.chrome", "com.google.android.apps.chrome.Main");
   try {
     startActivity(it);
   } catch (ActivityNotFoundException ex) {
     Intent intent =
         new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?id=com.android.chrome"));
     startActivity(intent);
   }
 }
Example #2
0
 public void doRestart() {
   try {
     String action = "org.mozilla.gecko.restart";
     Intent intent = new Intent(action);
     intent.setClassName(getPackageName(), getPackageName() + ".Restarter");
     addEnvToIntent(intent);
     intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
     Log.i(LOG_FILE_NAME, intent.toString());
     GeckoAppShell.killAnyZombies();
     startActivity(intent);
   } catch (Exception e) {
     Log.i(LOG_FILE_NAME, "error doing restart", e);
   }
   finish();
   // Give the restart process time to start before we die
   GeckoAppShell.waitForAnotherGeckoProc();
 }