Don't crash on startup if NFC is not available
This commit is contained in:
parent
6b2b759a16
commit
4e26c77327
@ -423,6 +423,7 @@ public class FDroid extends FragmentActivity {
|
|||||||
private void setupAndroidBeam() {
|
private void setupAndroidBeam() {
|
||||||
PackageManager pm = getPackageManager();
|
PackageManager pm = getPackageManager();
|
||||||
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);
|
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);
|
||||||
|
if (nfcAdapter != null) {
|
||||||
ApplicationInfo appInfo;
|
ApplicationInfo appInfo;
|
||||||
try {
|
try {
|
||||||
appInfo = pm.getApplicationInfo("org.fdroid.fdroid",
|
appInfo = pm.getApplicationInfo("org.fdroid.fdroid",
|
||||||
@ -436,4 +437,5 @@ public class FDroid extends FragmentActivity {
|
|||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user