Android examples for android.app:Activity
Check if system has Activity by package and class name
import android.app.Activity; import android.content.Context; import android.content.Intent; public class Main{ public static boolean hasActivity(Context context, String pkg, String cls) {/*from w ww. ja va2 s .c o m*/ boolean has = true; Intent intent = new Intent(); intent.setClassName(pkg, cls); if (context.getPackageManager().resolveActivity(intent, 0) == null) { has = false; } return has; } }