umano / AndroidSlidingUpPanel

This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.
http://umano.me
Apache License 2.0
9.5k stars 2.26k forks source link

PanelSlideListener on a null object reference #968

Open ModirGithub opened 5 years ago

ModirGithub commented 5 years ago

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo java.lang.NullPointerException: Attempt to invoke virtual method 'void com.sothree.slidinguppanel.SlidingUpPanelLayout.addPanelSlideListener(com.sothree.slidinguppanel.SlidingUpPanelLayout$PanelSlideListener)' on a null object reference

peter-yeh commented 5 years ago

did u initialise and declare the slider???

ModirGithub commented 5 years ago

did u initialise and declare the slider???

crashed on Android 8.0.0 other version fixed

ModirGithub commented 5 years ago

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo java.lang.NullPointerException: Attempt to invoke virtual method 'void com.sothree.slidinguppanel.SlidingUpPanelLayout.addPanelSlideListener(com.sothree.slidinguppanel.SlidingUpPanelLayout$PanelSlideListener)' on a null object reference

FIX this Bug by insert this cods after setContentView

if (Build.VERSION.SDK_INT == 26) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }