Reputation: 33
Can anyone help me understand why this isn't working?
Intent i = new Intent(Intent.ACTION_SEARCH);
i.setPackage("com.google.android.stardroid");
i.putExtra(SearchManager.QUERY, "mars");
startActivity(i);
This is in the oncreate method in the main Activity. I haven't added anything else to the manifest.
The error I'm getting is "No Activity found to handle intent"
Upvotes: 2
Views: 104
Reputation: 2000
This should definitely work
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.google.android.stardroid");
if (launchIntent != null) {
startActivity(launchIntent);//null pointer check in case package name was not found
}
Upvotes: 1