mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 18:07:55 +00:00
Fix crash when fragment.getContext() was null
This commit is contained in:
parent
9580154a13
commit
c93e4400e2
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.kde.kdeconnect_tp"
|
package="org.kde.kdeconnect_tp"
|
||||||
android:versionCode="1620"
|
android:versionCode="1621"
|
||||||
android:versionName="1.6.2">
|
android:versionName="1.6.2">
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="9"
|
<uses-sdk android:minSdkVersion="9"
|
||||||
|
@ -8,7 +8,7 @@ import android.net.NetworkInfo;
|
|||||||
public class NetworkHelper {
|
public class NetworkHelper {
|
||||||
|
|
||||||
public static boolean isOnMobileNetwork(Context context) {
|
public static boolean isOnMobileNetwork(Context context) {
|
||||||
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
|
if (context == null || android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
|
||||||
return false; //No good way to know it
|
return false; //No good way to know it
|
||||||
}
|
}
|
||||||
final ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
final ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user