Skip to content

Crash - with list is in startup view and touching screen upon startup #10

@robin-raymond

Description

@robin-raymond

Android (Galaxy S4)

Crashed on:

        public override bool OnInterceptTouchEvent(MotionEvent ev)
        {
           ...
            if (ev.ActionMasked == MotionEventActions.Down && ContentView.IsAtTop

-and-

        public override bool OnTouchEvent(MotionEvent e)
        {
                    ...
                    last_touch_y = ContentView.IsAtTop ? (int)e.RawY : -1;

There's a race condition where the content view is not set before the touch events arrive, i.e. the "OnGlobalLayout" gets called after the touch events arrive if you are touching the list view while the screen is still loading/rendering.

        public void OnGlobalLayout()
        {
                ...
                if (content_view_res_id > 0) {
                    ContentView = (IPullToRefresharpWrappedView)FindViewById<View>(content_view_res_id);
                } else {
                    ContentView = (IPullToRefresharpWrappedView)GetChildAt(1);
                }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions