super.onCreate(savedInstanceState);
XmlResourceParser parser = null;
try {
ActivityInfo ai = getPackageManager().getActivityInfo(
getComponentName(), PackageManager.GET_META_DATA);
parser = ai.loadXmlMetaData(getPackageManager(),
ALIAS_META_DATA);
if (parser == null) {
throw new RuntimeException("Alias requires a meta-data field "
+ ALIAS_META_DATA);
}
Intent intent = parseAlias(parser);
if (intent == null) {
throw new RuntimeException(
"No <intent> tag found in alias description");
}
startActivity(intent);
finish();
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException("Error parsing alias", e);
} catch (XmlPullParserException e) {
throw new RuntimeException("Error parsing alias", e);
} catch (IOException e) {
throw new RuntimeException("Error parsing alias", e);
} finally {
if (parser != null) parser.close();
}