Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.content.Intent;

import android.net.Uri;

public class Main {
    /**
     * 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);
    }
}