Articles in this section
Category / Section

How to resolve ItemTapped event not firing in Forms.Android when when MainActivity type is FormsApplicationActivity ?

2 mins read

ItemTapped event won’t get trigged for SfListView in Forms android when using main activity as FormsApplicationActivity. You can overcome this issue in two ways,

Way 1:

You can resolve the issue by inheriting MainActivity.cs from FormsAppCompatActivity. FormsAppCompatActivity is a replacement for FormsApplicationActivity and FormsApplicationActivity is marked as deprecated.

https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/

 

Way 2:

Set InputTransparent as false for android platform for Frame layout which restricts the touch event to child element.

<syncfusion:SfListView x:Name="listView"> 
  <syncfusion:SfListView.ItemTemplate> 
    <DataTemplate> 
      <Frame Padding="0" BackgroundColor="White" HasShadow="True"> 
        <Frame.InputTransparent> 
          <OnPlatform x:TypeArguments="x:Boolean" 
                      Android="False" WinPhone="False" iOS="False" /> 
        </Frame.InputTransparent> 
      </Frame> 
… 
    </DataTemplate> 
  </syncfusion:SfListView.ItemTemplate> 
</syncfusion:SfListView> 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied