消息页面对接数据接口, 礼包重复领取,删除无用文件

This commit is contained in:
khy
2017-04-21 16:32:44 +08:00
parent 8b637fbeec
commit 1fe9e259b4
91 changed files with 4404 additions and 5480 deletions

View File

@ -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();
}
}