I have a problem with an application when I tried to change the device's font (Samsung Galaxy Tab3), that being that my application crashes. In this case, the application is running in the background when I make the font change.
Steps:
I tried to test this scenario on other devices and can't reproduce it. My app crashed only on the Samsung device and only when the system font style changes.
Attached the log crash:
07-22 12:26:09.359: E/AndroidRuntime(8110): FATAL EXCEPTION: main
07-22 12:26:09.359: E/AndroidRuntime(8110): java.lang.NullPointerException
07-22 12:26:09.359: E/AndroidRuntime(8110): at com.acs.nomad.app.widget.h.a(Unknown Source)
07-22 12:26:09.359: E/AndroidRuntime(8110): at com.acs.nomad.app.b.ap.m(Unknown Source)
07-22 12:26:09.359: E/AndroidRuntime(8110): at com.acs.nomad.app.d.v.onPause(Unknown Source)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1129)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.app.BackStackRecord.popFromBackStack(BackStackRecord.java:662)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.app.FragmentManagerImpl.popBackStackState(FragmentManager.java:1450)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.app.FragmentManagerImpl$2.run(FragmentManager.java:444)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1401)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.app.FragmentManagerImpl$1.run(FragmentManager.java:426)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.os.Handler.handleCallback(Handler.java:615)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.os.Handler.dispatchMessage(Handler.java:92)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.os.Looper.loop(Looper.java:137)
07-22 12:26:09.359: E/AndroidRuntime(8110): at android.app.ActivityThread.main(ActivityThread.java:4949)
07-22 12:26:09.359: E/AndroidRuntime(8110): at java.lang.reflect.Method.invokeNative(Native Method)
07-22 12:26:09.359: E/AndroidRuntime(8110): at java.lang.reflect.Method.invoke(Method.java:511)
07-22 12:26:09.359: E/AndroidRuntime(8110): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1043)
07-22 12:26:09.359: E/AndroidRuntime(8110): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
07-22 12:26:09.359: E/AndroidRuntime(8110): at dalvik.system.NativeStart.main(Native Method)
Stock Android doesn't have a change device's font style
It must be a Samsung TouchWiz thing. May be, you should check out the Samsung specific SDKs.
But if I were you, I'd listen for the change in font style through a Broadcast Receiver. Find out which broadcast to listen to by using a Broadcast Monitor app from Google Play.
And then, I'd swallow the nullpointer exception and I'd restart the Activity whenever that happened. I realize this is a drastic action, but until you find out how the font style is causing the nullpointer exception, that's probably the only work around.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With