0x001 查看 安卓上层源码
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="content" /> <data android:scheme="file" /> <data android:mimeType="application/vnd.android.package-archive" /> </intent-filter>
0x002 写intent更新文件
private void installNewAPK() { // TODO Auto-generated method stub /* <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="content" /> <data android:scheme="file" /> <data android:mimeType="application/vnd.android.package-archive" /> </intent-filter> */ Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("android.intent.category.DEFAULT"); String apkType = "application/vnd.android.package-archive"; Uri apkData = Uri.fromFile(new File("sdcard/xxx.apk")); intent.setDataAndType(apkData, apkType); startActivity(intent); }
0则评论给“apk文件更新代码”