/** * 开启应用 */ private void startApp(String packageName) { PackageManager pm = getPackageManager(); Intent intent = pm.getLaunchIntentForPackage(packageName); try { startActivity(intent); } catch (Exception e) { // 做错误处理 Toast.makeText(this, "应用启动失败", Toast.LENGTH_SHORT).show(); } }
时间: 2024-11-02 16:44:57