exist Market App - Android App

Android examples for App:App Market

Description

exist Market App

Demo Code


//package com.java2s;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

public class Main {
    public static boolean existMarketApp(Context context) {
        Intent intent = new Intent();
        intent.setAction("android.intent.action.MAIN");
        intent.addCategory("android.intent.category.APP_MARKET");
        return verifyIntentReceiveApp(context, intent);
    }// www  . j  a v a  2 s  . c o m

    public static boolean verifyIntentReceiveApp(Context context,
            Intent intent) {
        PackageManager pm = context.getPackageManager();
        ComponentName componentName = intent.resolveActivity(pm);
        return componentName != null;
    }
}

Related Tutorials