Start Activity Android with class name -


i using following code start setting want launch setting activity started android ins

packagelist allowedappspackagename=callhelper.ds.getpackagelist();             packagemanager manager = calldetectservice.packagemanager;             intent mainintent = new intent(intent.action_main, null);             mainintent.addcategory(intent.category_launcher);          final list<resolveinfo> apps = manager.queryintentactivities(mainintent, 0);         collections.sort(apps, new resolveinfo.displaynamecomparator(manager));         final int count = apps.size();         resolveinfo info=new resolveinfo();;         gridviewapplist.clear();                   (int = 0; < count; i++)                   {                          info= apps.get(i);                         if(info.activityinfo.applicationinfo.packagename.contains("setting"))                             break;                   }                 applicationinfo application = new applicationinfo();                  application.title = info.loadlabel(manager);                 application.setactivity(new componentname(                         packagename,                         info.activityinfo.name),                         intent.flag_activity_new_task                         | intent.flag_activity_reset_task_if_needed);                 application.icon = info.activityinfo.loadicon(manager);                 application.packagename=packagename;                 log.i("pkg", application.packagename+" "+packagename+" "+info.activityinfo.name);                 gridviewapplist.add(application); 

you can use snippet open settings activity :

intent intent=new intent(); intent.setcomponent(new componentname("com.android.settings", "com.android.settings.settings")); startactivity(intent); 

if know activity have open,you can find it's name , it's package name mentioned here.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -