@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); // Resolve the intent final Intent intent = getIntent(); final String action = intent.getAction(); // If the intent is a request to create a shortcut, we'll do that and exit if (Intent.ACTION_CREATE_SHORTCUT.equals(action)) { setupShortcut(); finish(); return; } // If we weren't launched with a CREATE_SHORTCUT intent, simply put up an informative // display. // Inflate our UI from its XML layout description. setContentView(R.layout.launcher_shortcuts); // Provide a lightweight view of the Intent that launched us TextView intentInfo = (TextView) findViewById(R.id.txt_shortcut_intent); String info = intent.toString(); String extra = intent.getStringExtra(EXTRA_KEY); if (extra != null) { info = info + " " + extra; } intentInfo.setText(info); }
@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); // Resolve the intent final Intent intent = getIntent(); final String action = intent.getAction(); // If the intent is a request to create a shortcut, we'll do that and exit if (Intent.ACTION_CREATE_SHORTCUT.equals(action)) { setupShortcut(); finish(); return; } // If we weren't launched with a CREATE_SHORTCUT intent, simply put up an informative // display. // Inflate our UI from its XML layout description. setContentView(R.layout.launcher_shortcuts); // Provide a lightweight view of the Intent that launched us TextView intentInfo = (TextView) findViewById(R.id.txt_shortcut_intent); String info = intent.toString(); String extra = intent.getStringExtra(EXTRA_KEY); if (extra != null) { info = info + " " + extra; } intentInfo.setText(info); }