赞
踩
APP从后台调到前台
Intent intent = new Intent("android.intent.action.MAIN");
intent.setComponent(new ComponentName(getApplicationContext().getPackageName(), MainActivity.class.getName()));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplicationContext().startActivity(intent);
打开APP
private void openAPP(String appPackageName){
try{
//如果有,直接打开
Intent intent = this.getPackageManager().getLaunchIntentForPackage(appPackageName);
startActivity(intent);
}catch(Exception e){
Toast.makeText(this, "没有安装", Toast.LENGTH_LONG).show();
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。