Mai*_*dul 7 android updates android-intent apk
new apk
文件我下载这个并尝试安装.new version of apk file
那么我想更新我的.apk文件.我对此并不了解更多.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "jarviz.apk")), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Run Code Online (Sandbox Code Playgroud)
但这不起作用.我在调试时看不到任何错误,但它没有安装.我怎么能这样做.对于糟糕的英语.
我用这种方式解决了这个问题.
String vsName=Environment.getExternalStorageDirectory().getAbsolutePath()+"/download/";
File file = new File(vsName, "jarviz.apk");
System.out.println(":"+file);
Intent install=new Intent(Intent.ACTION_VIEW);
install.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
install.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(install);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1402 次 |
最近记录: |