Skip to content

Instantly share code, notes, and snippets.

@justintuchek
Last active November 2, 2015 01:54
Show Gist options
  • Save justintuchek/46e7c310d8a13e34369a to your computer and use it in GitHub Desktop.
Save justintuchek/46e7c310d8a13e34369a to your computer and use it in GitHub Desktop.
public class IntentFactory {
private IntentFactory() {
throw new AssertionError("no instances.");
}
public static <T extends Activity> Intent createExplicit(@NonNull Class<T> c) {
Intent explicitIntent = new Intent();
ComponentName componentName = new ComponentName(BuildConfig.APPLICATION_ID, c.getName());
explicitIntent.setComponent(componentName);
return new Intent();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment