Launches to the specific app in the Android Marketplace. - Android App

Android examples for App:App Install

Description

Launches to the specific app in the Android Marketplace.

Demo Code


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

import android.net.Uri;

public class Main {
    /**//from  w  w w .j a va2  s  .com
     * Launches to the specific app in the Android Marketplace.
     *
     * @param context Application or Activity context
     * @param action Desired action
     */
    public static void launchToMarketplace(final Context context,
            final String action) {
        final Uri intentUri = Uri
                .parse("market://search?q=pname:" + action);

        final Intent intent = new Intent(Intent.ACTION_VIEW, intentUri);

        context.startActivity(intent);
    }
}

Related Tutorials