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
Post a Comment