File tree Expand file tree Collapse file tree 4 files changed +37
-9
lines changed Expand file tree Collapse file tree 4 files changed +37
-9
lines changed Original file line number Diff line number Diff line change 11apply plugin : ' com.android.library'
22
33android {
4- compileSdkVersion 26
5- buildToolsVersion " 26 .0.0 "
4+ compileSdkVersion 28
5+ buildToolsVersion " 28 .0.3 "
66
77 defaultConfig {
88 minSdkVersion 14
9- targetSdkVersion 26
9+ targetSdkVersion 28
1010 versionCode 1
1111 versionName " 1.0"
1212
Original file line number Diff line number Diff line change 11apply plugin : ' com.android.application'
22
33android {
4- compileSdkVersion 26
5- buildToolsVersion ' 26 .0.3'
4+ compileSdkVersion 28
5+ buildToolsVersion ' 28 .0.3'
66 defaultConfig {
77 applicationId " com.umeng.soexample"
88 minSdkVersion 18
9- targetSdkVersion 22
9+ targetSdkVersion 28
1010 versionCode 1
1111 versionName " 1.0"
1212 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
Original file line number Diff line number Diff line change 77 android : icon =" @mipmap/ic_launcher"
88 android : name =" .App"
99 android : supportsRtl =" true" >
10+ <!-- targetSDKVersion 28 开启http请求,避免net::ERR_CLEARTEXT_NOT_PERMITTED错误-->
11+ android:usesCleartextTraffic="true">
1012
13+ <!-- 明确引用org.apache.http.legacy库,避免QQ官方open sdk在Android 9上报错 -->
14+ <uses-library android : name =" org.apache.http.legacy" android : required =" false" />
1115 <!-- demo启动页-->
1216 <activity
1317 android : name =" .push.SplashTestActivity"
140144 android : noHistory =" true" >
141145 <intent-filter >
142146 <action android : name =" android.intent.action.VIEW" />
143-
144147 <category android : name =" android.intent.category.DEFAULT" />
145148 <category android : name =" android.intent.category.BROWSABLE" />
146-
147149 <data android : scheme =" tencent100424468" />
148150 </intent-filter >
149151 </activity >
152154 android : screenOrientation =" portrait"
153155 android : theme =" @android:style/Theme.Translucent.NoTitleBar"
154156 android : configChanges =" orientation|keyboardHidden|screenSize" />
157+
155158 <uses-library
156159 android : name =" com.google.android.maps"
157160 android : required =" false" />
209212
210213 </application >
211214
215+ <uses-permission android : name =" android.permission.ACCESS_NETWORK_STATE" />
216+ <uses-permission android : name =" android.permission.ACCESS_WIFI_STATE" />
217+ <uses-permission android : name =" android.permission.INTERNET" />
218+ <uses-permission android : name =" android.permission.READ_PHONE_STATE" />
219+ <uses-permission android : name =" android.permission.WRITE_EXTERNAL_STORAGE" />
220+ <uses-permission android : name =" android.permission.READ_EXTERNAL_STORAGE" />
221+
222+
212223</manifest >
Original file line number Diff line number Diff line change 11package com .umeng .soexample ;
22
3+ import android .Manifest ;
34import android .content .Intent ;
5+ import android .os .Build ;
46import android .os .Bundle ;
7+ import android .support .annotation .NonNull ;
8+ import android .support .v4 .app .ActivityCompat ;
59import android .view .View ;
610import android .view .View .OnClickListener ;
711
@@ -47,12 +51,25 @@ public void onClick(View view) {
4751 startActivity (intent );
4852 }
4953 });
54+
55+ if (Build .VERSION .SDK_INT >= 23 ){
56+ String [] mPermissionList = new String []{
57+ Manifest .permission .WRITE_EXTERNAL_STORAGE ,
58+ Manifest .permission .READ_PHONE_STATE ,
59+ Manifest .permission .READ_EXTERNAL_STORAGE };
60+ this .requestPermissions (mPermissionList , 123 );
61+ }
62+ }
63+
64+
65+ @ Override
66+ public void onRequestPermissionsResult (int requestCode , String [] permissions , int [] grantResults ) {
67+ super .onRequestPermissionsResult (requestCode , permissions , grantResults );
5068 }
5169
5270 @ Override
5371 public int getLayout () {
5472 return R .layout .activity_home ;
5573 }
5674
57-
5875}
You can’t perform that action at this time.
0 commit comments