Amokrane
2/3/2012 - 12:57 PM

The parallel activity pattern

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();
}