Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

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

public class Main {

    public static boolean isActivityExists(Context context, String packageName, String className) {
        Intent intent = new Intent();
        intent.setClassName(packageName, className);
        return !(context.getPackageManager().resolveActivity(intent, 0) == null
                || intent.resolveActivity(context.getPackageManager()) == null
                || context.getPackageManager().queryIntentActivities(intent, 0).size() == 0);
    }
}