Shortcut utilities lost after reboot?

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.

+3
source share
1 answer

I answer my question. I put the String array in intention optionally. String arrays will not be saved on the main screen!

I found the answer at: http://groups.google.com/group/android-developers/browse_thread/thread/7f2ce458bd5d112f/189e2b7b2b2532d7

+1
source

Source: https://habr.com/ru/post/887075/


All Articles