1

Android: Is there a way to send intent.ACTION_VIEW together with intent.setComponent(), so that there in no choose of apps, but to launch a special app (not my own) on phone with ACTION_VIEW? Something like this (but does not work):

String url = "http://something";
Intent in = new Intent(Intent.ACTION_VIEW); 
in.setData(Uri.parse(url));
in.setComponent(new ComponentName(packageName, name));
startActivity(in);

Of cause this works:

String url = "http://something";
Intent in = new Intent(Intent.ACTION_VIEW); 
in.setData(Uri.parse(url));
startActivity(in);

and this too:

Intent in = new Intent("android.intent.action.MAIN");
in.addCategory("android.intent.category.LAUNCHER");
in.setComponent(new ComponentName(packageName, name));
startActivity(in);
4

0 回答 0