Bottomsheetbehavior Java.lang.IllegalArgumentException:The view is not associated with Bottomsheetbehavior

Source: Internet
Author: User

09-14 22:52:58.891 13674-13674/me.chunsheng.uberdriver e/androidruntime:fatal exception:main                                                                         Process:me.chunsheng.uberdriver, pid:13674 Java.lang.RuntimeException:Unable to start Activity Componentinfo{me.chunsheng.ub Erdriver/me.chunsheng.uberdriver.mainactivity}: Java.lang.IllegalArgumentException:The view isn't associated with Bottomsheetbehavior at ANDROID.APP.ACTIVITYTHR                                                                             Ead.performlaunchactivity (activitythread.java:2503)                                                                             At Android.app.ActivityThread.handleLaunchActivity (activitythread.java:2570)                                                  At android.app.activitythread.access$800 (activitythread.java:162)                           At Android.app.activitythread$h.handlemessage (activitythread.java:1446)                                                                             At Android.os.Handler.dispatchMessage (handler.java:102)                                                                             At Android.os.Looper.loop (looper.java:135)                                                                             At Android.app.ActivityThread.main (activitythread.java:5528) At Java.lang.reflect.Method.invoke (Native metho d) at Java.lang.reflect.Method.invoke (METHOD.J ava:372) at Com.android.internal.os.ZygoteInit                                                                             $MethodAndArgsCaller. Run (zygoteinit.java:952) At Com.android.internal.Os. Zygoteinit.main (zygoteinit.java:747) caused by:j                                                                             Ava.lang.IllegalArgumentException:The view isn't associated with Bottomsheetbehavior At Android.support.design.widget.BottomSheetBehavior.from (bottomsheetbehavior.jav a:710) at Me.chunsheng.uberdriver.MainActivity . OnCreate (mainactivity.java:27) at Android.app . Activity.performcreate (activity.java:6074) at                                                                             Android.app.Instrumentation.callActivityOnCreate (instrumentation.java:1117)                                   At Android.app.ActivityThread.performLaunchActivity (activitythread.java:2456)                                          At Android.app.ActivityThread.handleLaunchActivity (activitythread.java:2570) &nbs                                                                             P                                                                             At android.app.activitythread.access$800 (activitythread.java:162)                                                                               At Android.app.activitythread$h.handlemessage (activitythread.java:1446)                                                                               At Android.os.Handler.dispatchMessage (handler.java:102)                                                                                At Android.os.Looper.loop (looper.java:135)   At Android.app.ActivityThread.main (Activityth read.java:5528)   at Java.lang.reflect.Met                                    Hod.invoke (Native Method)                                           At Java.lang.reflect.Method.invoke (method.java:372)   At Com.android.internal.os.zygoteinit$methodandargscaller.run (Zygotei nit.java:952)   at Com.android.internal.os . Zygoteinit.main (zygoteinit.java:747)  09-14 22:52:58.951 13674-13674/me.chunsheng.uberdriver I/Process: Sending signal. pid:13674 Sig:9

Error message above: View and Bottomsheetbehavior do not match???

What the hell is this???

Since the Bottomsheetbehavior-filled view needs to be a sub-view of the android.support.design.widget.CoordinatorLayout, this time, for example, the view is a relative layout in the layout, Need to write this:

<relativelayout        android:id= "@+id/layout_bottom_sheet"        android:layout_width= "Match_parent        " android:layout_height= "250DP"        android:background= "@android: Color/white"        android:elevation= "8DP"        App:behavior_hideable= "true"        app:behavior_peekheight= "90DP"        app:layout_behavior= " Android.support.design.widget.BottomSheetBehavior ">        <textview            android:id=" @+id/text_view_ Sheet_title "            android:layout_width=" match_parent "            android:layout_height=" Wrap_content "            android: padding= "@dimen/activity_vertical_margin"            android:text= "click to call the car, on the sliding select car"            android:textsize= "14sp"/>    </RelativeLayout>

Note the Red statement, which is correct when filling the view with Bottomsheetbehavior.

Bottomsheetbehavior Java.lang.IllegalArgumentException:The View is not associated with Bottomsheetbehavior

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.