开发者

How to pass intent extras to broadcast reciever?

开发者 https://www.devze.com 2023-04-07 06:51 出处:网络
I\'ve been trying to get an android application to install an APK on the sdcard programmatically and to delete the apk once it\'s installed.

I've been trying to get an android application to install an APK on the sdcard programmatically and to delete the apk once it's installed.

This is how I'm doing it:

Intent intent = new Intent(Intent.ACTION_VIEW);

intent.setDataAndType("开发者_如何学CApkFilePath...","application/vnd.android.package-archive"); intent.putExtra("apkname", apkName); activity.start(intent);

And I have written a braodcast-reciever class so that I can handle apk deletion process there once the app is installed. But I can't get extras passed from my intent in the broadcast-reciever.

0

精彩评论

暂无评论...
验证码 换一张
取 消