繁体   English   中英

从通知栏安装android应用

[英]installing android app from notification bar

根据我的应用程序概念,我们不会在Play商店中提交该应用程序。

每当用户启动应用程序时,它都会通过Web服务检查最新更新。 如果服务器中有最新的APK,它将下载到SD卡中的特定路径。 下载过程显示在通知栏中。 这是我的问题。

After download is completed, the notification is shown in Notification bar as "App is completed downloading" with app icon. Now when the user touches the my apps notification i want it to be either installed or need to open the sd card path. How to implement this process

尝试这个:

     Intent install_intent = new Intent(Intent.ACTION_VIEW);
     install_intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory().getPath() + "/myapp.apk")),"application/vnd.android.package-archive");
     PendingIntent pending = PendingIntent.getActivity(YourAcrtivity.this,0, install_intent, 0);
     notification.setContentIntent(pending);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM