public void onClick(View v) {
Intent chapter;
chapter = new Intent("c.theworld.com.nikhil.CHAPTER");
switch (v.getId()) {
case R.id.subjects:
try {
Intent marketIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("market://details?id=nik.trivia"));
marketIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(marketIntent);
} catch (ActivityNotFoundException e) {
startActivity(chapter);
}
break;
}
It worked on my phone.. but it is not taking me to the app’s download page..it is taking me to the home page of google play ( market )..!
It is also opening the page without internet..i have added the internet permissions
Are you trying this in emulator? If yes then be sure you have installed Android Market application in your emulator. Or just test it on Android device which has already installed Android Market application.