消息页面对接数据接口, 礼包重复领取,删除无用文件
This commit is contained in:
@ -228,11 +228,16 @@ public class PackageUtils {
|
||||
*/
|
||||
public static void launchApplicationByPackageName(Context context,
|
||||
String packageName) {
|
||||
Intent intent = context.getPackageManager().getLaunchIntentForPackage(
|
||||
packageName);
|
||||
if (intent != null) {
|
||||
context.startActivity(intent);
|
||||
} else {
|
||||
try {
|
||||
Intent intent = context.getPackageManager().getLaunchIntentForPackage(
|
||||
packageName);
|
||||
if (intent != null) {
|
||||
context.startActivity(intent);
|
||||
} else {
|
||||
Toast.makeText(context, "启动失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Toast.makeText(context, "启动失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user