Android10 获取网络权限

文章目录

包含问题

  • webview使用方法 2020-10-16 E/chromium: [ERROR:address_tracker_linux.cc(245)] Could not send NETLINK request: Permission denied (13)配套使用以下方法。
		/// 第一种方法
        web_01 = findViewById(R.id.web_01);// WebView对象
        ......各种设置,参考菜鸟教程......
        web_01.loadUrl("https://blog.csdn.net/qq_33721320/article/details/84400825");
        /// 第二种方法
        web_01 = new WebView(this);// WebView对象
        ......各种设置,参考菜鸟教程......
        setContentView(web_01);
  • net::ERR_CLEARTEXT_NOT_PERMITTED无法加载url
  • 添加usesCleartextTraffic还是不能显示网页,因为sdk版本问题,要求sdk23以上,我的时minsdk21,因此添加tools:targetApi即可。

获取方式

<uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        tools:targetApi="m">
</application>

猜你喜欢

转载自blog.csdn.net/weixin_37627774/article/details/109115815