ConnectSDK / Connect-SDK-Android-API-Sampler

Creative Commons Zero v1.0 Universal
24 stars 21 forks source link

Crash: Null pointer exception #15

Closed khk624 closed 9 years ago

khk624 commented 9 years ago

01-19 14:14:25.078: E/AndroidRuntime(18621): FATAL EXCEPTION: main 01-19 14:14:25.078: E/AndroidRuntime(18621): Process: com.connectsdk.sampler, PID: 18621 01-19 14:14:25.078: E/AndroidRuntime(18621): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.connectsdk.sampler/com.connectsdk.sampler.MainActivity}: java.lang.NullPointerException 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2202) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2252) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.app.ActivityThread.access$800(ActivityThread.java:139) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1200) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.os.Handler.dispatchMessage(Handler.java:102) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.os.Looper.loop(Looper.java:136) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.app.ActivityThread.main(ActivityThread.java:5103) 01-19 14:14:25.078: E/AndroidRuntime(18621): at java.lang.reflect.Method.invokeNative(Native Method) 01-19 14:14:25.078: E/AndroidRuntime(18621): at java.lang.reflect.Method.invoke(Method.java:515) 01-19 14:14:25.078: E/AndroidRuntime(18621): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) 01-19 14:14:25.078: E/AndroidRuntime(18621): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606) 01-19 14:14:25.078: E/AndroidRuntime(18621): at dalvik.system.NativeStart.main(Native Method) 01-19 14:14:25.078: E/AndroidRuntime(18621): Caused by: java.lang.NullPointerException 01-19 14:14:25.078: E/AndroidRuntime(18621): at com.connectsdk.sampler.fragments.MediaPlayerFragment.disableButtons(MediaPlayerFragment.java:354) 01-19 14:14:25.078: E/AndroidRuntime(18621): at com.connectsdk.sampler.fragments.BaseFragment.setTv(BaseFragment.java:84) 01-19 14:14:25.078: E/AndroidRuntime(18621): at com.connectsdk.sampler.fragments.MediaPlayerFragment.setTv(MediaPlayerFragment.java:149) 01-19 14:14:25.078: E/AndroidRuntime(18621): at com.connectsdk.sampler.MainActivity.onTabSelected(MainActivity.java:315) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.support.v7.internal.app.WindowDecorActionBar.selectTab(WindowDecorActionBar.java:634) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.support.v7.internal.app.WindowDecorActionBar.addTab(WindowDecorActionBar.java:563) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.support.v7.internal.app.WindowDecorActionBar.addTab(WindowDecorActionBar.java:549) 01-19 14:14:25.078: E/AndroidRuntime(18621): at com.connectsdk.sampler.MainActivity.onCreate(MainActivity.java:137) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.app.Activity.performCreate(Activity.java:5275) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 01-19 14:14:25.078: E/AndroidRuntime(18621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2166) 01-19 14:14:25.078: E/AndroidRuntime(18621): ... 11 more

khk624 commented 9 years ago

Step to reproduce, 1) after applying https://github.com/ConnectSDK/Connect-SDK-Android-API-Sampler/commit/ae3d9dcffa93ccdf84f7e6252fb8567d653eed97 2) Open Sampler 3) Slide down top control bar and toggle the usb mode 4) Crash

khk624 commented 9 years ago

This has been resolved in https://github.com/ConnectSDK/Connect-SDK-Android-API-Sampler/commit/3786d89e1944f479ff0494b40588c4c1cccc7876