My application listens for the android.intent.action.CREATE_SHORTCUT broadcast, in my code I create a shortcut that includes an extra line:
Intent shortcutIntent = new Intent(Intent.ACTION_VIEW); shortcutIntent.setClassName("com.some.name","com.some.name.Activity"); shortcutIntent.putExtra("stringid", "some string value"); ShortcutIconResource iconResource = Intent.ShortcutIconResource.fromContext(ShortcutActivity.this,iconIdentifier); Intent intent = new Intent(); intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, channelName); intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource); setResult(RESULT_OK, intent);
Working with shortcuts, but additional functions are lost each time the phone is rebooted (they return zero, I checked the logs and debugged). Is this normal behavior? Am I doing it wrong? I need to transfer additional services.
source share