android - How to launch task shortcut from resolve info? -


i have gotten list of shortcuts using:

packagemanager.queryintentactivities(new intent(intent.action_create_shortcut), packagemanager.match_all); 

and have list of tasks shown user. once 1 clicked use try launch activity:

resolveinfo info = adapter.getitem(position); componentname name = new componentname(info.activityinfo.applicationinfo.packagename, info.activityinfo.name); intent intent = new intent(intent.action_main, null); intent.addcategory(intent.category_launcher); intent.setcomponent(name); intent.setflags(intent.flag_activity_new_task); startactivityforresult(intent, 8); 

and launches shortcut shortcut instantly closes result result_canceled. have no idea why close unless action wrong (i tried using intent.action_create_shortcut). :d


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -