Skip to content

Instantly share code, notes, and snippets.

@Amokrane
Created February 3, 2012 12:57
Show Gist options
  • Save Amokrane/1730048 to your computer and use it in GitHub Desktop.
Save Amokrane/1730048 to your computer and use it in GitHub Desktop.
The parallel activity pattern
private static boolean shinyNewAPIS = android.os.Build.VERSION_SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent startActivityIntent = null;
if(!shinyNewAPIS) {
startActivityIntent = new Intent(this, legacyActivity.class);
} else {
startActivityIntent = new Intent(this, icsActivity.class);
}
startActivity(startActivityIntent);
finish();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment