Android跳转应用安装页面
一.低版本跳转方式 Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(uri,"application/vnd.android.package-archive"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivityForResult(intent, 666); uri是apk的uri。 记得不要忘了在manifest中加权限,这里就不写出来了。低版本的跳转很简单,但是到了android7.0之后,加了一个机制: Android N对访问文件权限收回。所以我们要使用FileProvider来单独授权。 二.Android 7.0跳转方式 1.在manifest中添加provider <provider android:name="android.support.v4.content.FileProvider" android:authorities="独一无二的名字.fileProvider" android:grant...