首页 > 学院 > 开发设计 > 正文

启动第三方非入口activity

2019-11-09 16:07:06
字体:
来源:转载
供稿:网友

1,首先第三方app非入口activity要有android:exported="true"属性,在mainfest.xml里面写

2,

public static void startActivity(Context mContext,String packageName,String  className){		try {			Intent intent = new Intent(Intent.ACTION_MAIN);  			intent.addCategory(Intent.CATEGORY_LAUNCHER);              			ComponentName cn = new ComponentName(packageName, className);              			intent.setComponent(cn);  			mContext.startActivity(intent);  				} catch (Exception e) {			// TODO: handle exception			LogUtils.i(Tag, ""+e);  		}	 	}


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表