android - Checking existence of an Activity -


i considering code in this question, , did following:

first, create simple, empty project 1 activity called mainactivity, in package com.example.plugins. compile project , install device. app works fine.

then, in project have code:

intent plugins = new intent(); plugins.setclassname("com.example.plugins", "mainactivity"); list<resolveinfo> list = getpackagemanager().queryintentactivities(plugins,                 packagemanager.match_default_only); if (list.size() > 0) {     tvtext.settext("plugins."); } else {     tvtext.settext("no plugins."); } 

i'd should work, doesn't. gives "no plugins". missing here?

update when using

packageinfo pi = getpackagemanager().getpackageinfo(                     "com.example.plugins", packagemanager.get_activities); 

i activities other app.

i think mime-type of intent missing.

plugins.settype("text/plain"); 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -