I am developing an android application with one basic function, to allow the user to click a button and download the full app from the android market (a virtual preload type app similar to the apps which come pre-loaded on the phone, which you have to actually install first to use) .
In my Activity class I create a Button and call the setOnClickListener…
marketButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String urlToMarket = "market://search?q=<package.name>";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(urlToMarket));
startActivity(i);
}
});
i get an ActivityNotFoundException: No Activity found to handle intent. How do I code a handler for this intent?
Try this: