Bug 40858 - SearchBar LongClick Crashes on ListView Header
Summary: SearchBar LongClick Crashes on ListView Header
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.2.0
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-05-04 13:09 UTC by ebubekirakgul
Modified: 2016-08-04 17:27 UTC (History)
6 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:


Attachments
example project (45.25 KB, application/zip)
2016-06-03 00:04 UTC, Pete Schmitz
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description ebubekirakgul 2016-05-04 13:09:16 UTC
Steps to reproduce:

    - Create a ListView that Header property contains a Searchbar like below:

         <ListView x:Name="listView">
          <ListView.Header>
            <StackLayout HeightRequest="50">
              <SearchBar Placeholder="click to search"/>
            </StackLayout>
          </ListView.Header>
        </ListView>

    - Run the code on Android
    - Long press to Search bar on ListViewHeader


    Result:

    App Crashes with NullReferenceException below StackTrace:


      at Xamarin.Forms.Platform.Android.CellAdapter.HandleContextMode (Android.Views.View view, Int32 position) [0x00090] in <filename unknown>:0 
      at Xamarin.Forms.Platform.Android.CellAdapter.OnItemLongClick (Android.Widget.AdapterView parent, Android.Views.View view, Int32 position, Int64 id) [0x00014] in <filename unknown>:0 
      at Android.Widget.AdapterView+IOnItemLongClickListenerInvoker.n_OnItemLongClick_Landroid_widget_AdapterView_Landroid_view_View_IJ (IntPtr jnienv, IntPtr native__this, IntPtr native_parent, IntPtr native_view, Int32 position, Int64 id) [0x00019] in /Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Widget.AdapterView.cs:360 
      at (wrapper dynamic-method) System.Object:288a13fc-8bf8-42a1-b868-3f8a1ec38351 (intptr,intptr,intptr,intptr,int,long)
Comment 1 Pete Schmitz 2016-06-03 00:04:46 UTC
Created attachment 16184 [details]
example project

This also occurs when the listview header contains an Entry or Editor.
Comment 2 Pete Schmitz 2016-06-03 00:06:03 UTC
To elaborate, the above exception is thrown when the entry or editor in the listview header is long-clicked.
Comment 3 Samantha Houts [MSFT] 2016-08-02 16:25:02 UTC
Should be fixed in 2.3.2-pre1. Thank you!
Comment 4 Parmendra Kumar 2016-08-04 17:27:07 UTC
I have checked this issue with Xamarin.Forms 2.3.2-pre1 and observed that this issue is working fine.


Hence closing this issue.