launch App Market - Android App

Android examples for App:App Market

Description

launch App Market

Demo Code


//package com.java2s;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class Main {

    public static void launchAppMarket(Context context, String pkgname) {
        Uri uri = Uri.parse("market://details?id=" + pkgname);
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);/* w  w  w  .  j  av a  2 s . c  o m*/
    }
}

Related Tutorials