List of usage examples for android.app Activity startActivityIfNeeded
public boolean startActivityIfNeeded(@RequiresPermission @NonNull Intent intent, int requestCode)
From source file:Main.java
public static void openBrowser(Activity activity, String url) { final Uri uri = Uri.parse(url); final Intent intent = new Intent(Intent.ACTION_VIEW, uri); activity.startActivityIfNeeded(intent, 0); }
From source file:org.kontalk.ui.PreferencesActivity.java
public static void start(Activity context) { Intent intent = new Intent(context, PreferencesActivity.class); context.startActivityIfNeeded(intent, -1); }
From source file:com.songcode.materialnotes.ui.NotesListActivity.java
private void startPreferenceActivity() { Activity from = getParent() != null ? getParent() : this; Intent intent = new Intent(from, NotesPreferenceActivity.class); from.startActivityIfNeeded(intent, -1); }