Builds a new intent to launch LockActivity with the previously configured options

@param context a valid Context
@return the intent to which the user has to call startActivity or startActivityForResult
336036
@SuppressWarnings("unused")
    public Intent newIntent(Context context) {
        Intent lockIntent = new Intent(context, PasswordlessLockActivity.class);
        lockIntent.putExtra(Constants.OPTIONS_EXTRA, options);
        lockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        return lockIntent;
    }
843624
public void startAuthActivity(Context context, Bundle extras) {
        if (!startDelegateActivity(context, delegate.getAuthStartIntent(), extras)) {
            startActivity(context, extras, AuthActivity.class);
        }
    }
626759
public final void startActivity(@NonNull final Intent intent) {
        executeWithRouter(new RouterRequiringFunc() {
            @Override public void execute() { router.startActivity(intent); }
        });
    }
1248498
def build(self):
        
        return Intent(self.name, self.requires, self.at_least_one, self.optional)
1033154
static void runIntentInService(Context context, Intent intent,
            String className) {
        synchronized (LOCK) {
            if (sWakeLock == null) {
                // This is called from BroadcastReceiver, there is no init.
                PowerManager pm = (PowerManager)
                        context.getSystemService(Context.POWER_SERVICE);
                sWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
                        WAKELOCK_KEY);
            }
        }
        Log.v(TAG, "Acquiring wakelock");
        sWakeLock.acquire();
        intent.setClassName(context, className);
        context.startService(intent);
    }
516256
@SuppressWarnings("deprecation")
    private void initLockScreenRemoteControlClient(Context context) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
            mMediaButtonReceiverComponent = new ComponentName(
                    mRuntimePackageName, MediaSessionReceiver.class.getName());
            mAudioManager.registerMediaButtonEventReceiver(mMediaButtonReceiverComponent);

            if (mRemoteControlClientCompat == null) {
                Intent remoteControlIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
                remoteControlIntent.setComponent(mMediaButtonReceiverComponent);
                mRemoteControlClientCompat = new RemoteControlClientCompat(
                        PendingIntent.getBroadcast(context, 0, remoteControlIntent, 0));
                RemoteControlHelper.registerRemoteControlClient(mAudioManager, mRemoteControlClientCompat);

            }
            mRemoteControlClientCompat.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
            mRemoteControlClientCompat.setTransportControlFlags(RemoteControlClient.FLAG_KEY_MEDIA_PLAY
                    | RemoteControlClient.FLAG_KEY_MEDIA_PAUSE
                    | RemoteControlClient.FLAG_KEY_MEDIA_NEXT
                    | RemoteControlClient.FLAG_KEY_MEDIA_STOP
                    | RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS
                    | RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE);

            registerLockScreenReceiver(context);
        }
    }
663708
public static void navigateToActivity(Context A, Class<?> B, Bundle extras) {
        Intent myIntent = new Intent(A, B);
        myIntent.putExtras(extras);
        A.startActivity(myIntent);
    }
833685
@NonNull
    public Intent build() {
        Uri mailtoUri = constructMailtoUri();
        return new Intent(Intent.ACTION_SENDTO, mailtoUri);
    }
351688
final void launchIntent(Intent intent) {
    try {
      rawLaunchIntent(intent);
    } catch (ActivityNotFoundException ignored) {
      AlertDialog.Builder builder = new AlertDialog.Builder(activity);
      builder.setTitle(R.string.app_name);
      builder.setMessage(R.string.msg_intent_failed);
      builder.setPositiveButton(R.string.button_ok, null);
      builder.show();
    }
  }
310991
public static void startActivity(@NonNull Context context, @Nullable JSONObject jsonObject) {
        Intent intent = new Intent(context, JSONViewerActivity.class);
        Bundle bundle = new Bundle();
        if (jsonObject != null) {
            bundle.putString(JSON_OBJECT_STATE, jsonObject.toString());
        }
        intent.putExtras(bundle);
        context.startActivity(intent);
    }
1010288
public Object start(IApplicationContext context) {
		Display display = PlatformUI.createDisplay();
		try {
/* FIXME: the static Sisu.lookup utility is currently being reworked...
			int returnCode = PlatformUI.createAndRunWorkbench(display, Sisu.lookup(WorkbenchAdvisor.class));
			if (returnCode == PlatformUI.RETURN_RESTART) {
				return IApplication.EXIT_RESTART;
			}
*/
			return IApplication.EXIT_OK;
		} finally {
			display.dispose();
		}
	}
1031225
public static void startActivity(Context context, String artistName) {
        Intent i = new Intent(context, ArtistActivity.class);
        i.putExtra(BUNDLE_KEY_ARTIST_NAME, artistName);
        context.startActivity(i);
    }
773673
@NonNull public static Activity getActivity(@NonNull Context context) {
    if (context == null) {
      throw new NullPointerException("context == null");
    }
    if (context instanceof Activity) {
      return (Activity) context;
    }

    while (context instanceof ContextWrapper) {
      if (context instanceof Activity) {
        return (Activity) context;
      }
      context = ((ContextWrapper) context).getBaseContext();
    }
    throw new IllegalStateException("Could not find the surrounding Activity");
  }
1298502
public final void startActivityForResult(@NonNull final Intent intent, final int requestCode, @Nullable final Bundle options) {
        executeWithRouter(new RouterRequiringFunc() {
            @Override public void execute() { router.startActivityForResult(instanceId, intent, requestCode, options); }
        });
    }
157668
public static RxBleClient create(@NonNull Context context) {
        return DaggerClientComponent
                .builder()
                .applicationContext(context.getApplicationContext())
                .build()
                .rxBleClient();
    }
986852
public static boolean launchAppForPackage(final Context context, final String packageName) {
        try {
            final PackageManager packageManager = context.getPackageManager();
            final Intent intent = packageManager.getLaunchIntentForPackage(packageName);
            intent.addCategory(Intent.CATEGORY_LAUNCHER);
            context.startActivity(intent);
            return true;
        } catch (Exception ex) {
            Log.e("Caffeine", "Failed to launch application for package name [" + packageName + "]", ex);
            return false;
        }
    }
1362154
private void startActivity(int requestCode, Context currentContext, Intent intent, Postcard postcard, NavigationCallback callback) {
        if (requestCode >= 0) {  // Need start for result
            if (currentContext instanceof Activity) {
                ActivityCompat.startActivityForResult((Activity) currentContext, intent, requestCode, postcard.getOptionsBundle());
            } else {
                logger.warning(Consts.TAG, "Must use [navigation(activity, ...)] to support [startActivityForResult]");
            }
        } else {
            ActivityCompat.startActivity(currentContext, intent, postcard.getOptionsBundle());
        }

        if ((-1 != postcard.getEnterAnim() && -1 != postcard.getExitAnim()) && currentContext instanceof Activity) {    // Old version.
            ((Activity) currentContext).overridePendingTransition(postcard.getEnterAnim(), postcard.getExitAnim());
        }

        if (null != callback) { // Navigation over.
            callback.onArrival(postcard);
        }
    }