-
Notifications
You must be signed in to change notification settings - Fork 426
java.lang.NullPointerException inside initLayoutForFingerprint #172
Comments
@Vojtas87 make sure your activity extends PinActivity not your custom pin activity |
@norrisboat Yes, it does. My main activity (only this activity) extends PinCompatActivity. |
I have same problem with my app, on Sony devices with android 8.0+ I am always getting this error in my error log, my activity extends "AppLockActivity". Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.hardware.fingerprint.FingerprintManager.isHardwareDetected()' on a null object reference |
This is forced solution for those who are using "AppLockActivity" as base class. public abstract class MyAppLockActivity extends AppLockActivity {
} |
@smsrobot I have same issue. My custom activity already extends AppLockActivity and uses your code example, but nothing! Android 8.0+ still crashing. :( |
Added some tips on how to fix: |
@anton-piliugin yeah, thx, your solution works perfectly! |
Hello,
I received this crash report in my app (Android 8.0, Xperia XA1 (G3121)):
`java.lang.NullPointerException
com.github.omadahealth.lollipin.lib.managers.AppLockActivity.initLayoutForFingerprint
java.lang.RuntimeException: Unable to resume activity {CustomPinActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.hardware.fingerprint.FingerprintManager.isHardwareDetected()' on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3754)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3794)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2980)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1663)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:206)
at android.app.ActivityThread.main(ActivityThread.java:6749)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:845)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.hardware.fingerprint.FingerprintManager.isHardwareDetected()' on a null object reference
at com.github.omadahealth.lollipin.lib.managers.AppLockActivity.initLayoutForFingerprint(AppLockActivity.java:147)
at com.github.omadahealth.lollipin.lib.managers.AppLockActivity.onResume(AppLockActivity.java:84)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
at android.app.Activity.performResume(Activity.java:7089)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3724)
... 10 more`
Could you take a look at this, please?
Thank you in advance.
The text was updated successfully, but these errors were encountered: