Java.lang.IllegalArgumentException:parameter must be a descendant of this view

Source: Internet
Author: User

Log information

Java.lang.IllegalArgumentException:parameter must be a descendant of Thisview at Android.view.ViewGroup.offsetRectBetweenParentAndChild (Viewgroup.java:4555) at Android.view.ViewGroup.offsetDescendantRectToMyCoords (Viewgroup.java:4492) at Android.view.ViewRootImpl.scrollToRectOrFocus (Viewrootimpl.java:2659) at Android.view.ViewRootImpl.draw (Viewrootimpl.java:2303) at Android.view.ViewRootImpl.performDraw (Viewrootimpl.java:2252) at Android.view.ViewRootImpl.performTraversals (Viewrootimpl.java:1882) at Android.view.ViewRootImpl.doTraversal (Viewrootimpl.java:999) at Android.view.viewrootimpl$traversalrunnable.run (Viewrootimpl.java:5663) at Android.view.choreographer$callbackrecord.run (Choreographer.java:777) at Android.view.Choreographer.doCallbacks (Choreographer.java:587) at Android.view.Choreographer.doFrame (Choreographer.java:557) at Android.view.choreographer$framedisplayeventreceiver.run (Choreographer.java:763) at Android.os.Handler.handleCallback (Handler.java:733) at Android.os.Handler.dispatchMessage (Handler.java:95) at Android.os.Looper.loop (Looper.java:136) at Android.app.ActivityThread.main (Activitythread.java:5345At java.lang.reflect.Method.invokeNative (Native Method) at Java.lang.reflect.Method.invoke (Method.java:515) at Com.android.internal.os.zygoteinit$methodandargscaller.run (Zygoteinit.java:855) at Com.android.internal.os.ZygoteInit.main (Zygoteinit.java:671) at Dalvik.system.NativeStart.main (Native Method)

What happens when a bug occurs: Android system 4.4.2 and 4.4.4, there is a edittext edit box in the ListView Fit item, and the data is out of one screen. Immediately clicking on EditText in the last item pops up the soft keyboard and then shrinks the parent and then an exception occurs.

Workaround

 Public View GetView (int  position, view Convertview, ViewGroup parent) {    // Force Clear Current Focus Activity    activity = (activity) getcontext ();     = Activity.getcurrentfocus ();     if NULL ) {        currentfocus.clearfocus ();    }}

Java.lang.IllegalArgumentException:parameter must be a descendant of this view

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.