Open app by package name - Android App

Android examples for App:App Information

Description

Open app by package name

Demo Code


//package com.java2s;

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

public class Main {

    public static void OpenApp(Context context, String pkName) {
        Intent intent = context.getPackageManager()
                .getLaunchIntentForPackage(pkName);
        context.startActivity(intent);//w  w  w .  j a  v  a2 s . c  o m
    }
}

Related Tutorials