Samsung Galaxy Note, 4G LTE Plans, Transfer Photos Videos from iPhone to Samsung, Network Performance, Mobile Accounts, Furious Gold SPD TooL, Latest Version Full Setup

Info How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java

Info How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java - this blog we have built from a few years ago and already very much information about gadgets that we convey and a lot of blog visitors New Blog Techno News who are satisfied with the information, we will always try to update the latest information for you, first about Info How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java many already we collect data to make this article so you do not miss the news, please see:

Articles : Info How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java
full Link : Info How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java

You can also see our article on:


Info How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java

Hi there,

Now iam going to give you a solution for "How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java".

Introduction
Most of us we developers,facing problems while adding a ListView into a layout inside a ScrollView because of the screen size the items of the layout may overflow,so what we developers must want to use a ScrollView for solving that overflow problem.But there comes the problem what happense when we put a ListView as an item into the ScrollView.Due to multiple scrollable items in a single screen,the android os confused to handle the scroll event for which item the ListView or ScrollView,atlast it will give scroll event to ScrollView as it is the top most view considering the ListView.



How to get the touch event to ListView?
Don't feel overloaded it is simple to get all the things done.

  • Only one thing we want to do is just initialize a custom TouchListener for the ListView.
  • Initialize the ListView 

ListView itemsList=(ListView)findViewById(R.id.listItemsSale);

  •  Now simply add a TouchListener to the ListView.
itemsList.setOnTouchListener(new OnTouchListener() {
   // Setting on Touch Listener for handling the touch inside ScrollView
   @Override
   public boolean onTouch(View v, MotionEvent event) {
   // Disallow the touch request for parent scroll on touch of child view
   v.getParent().requestDisallowInterceptTouchEvent(true);
   return false;
   }
});

Conclusion
Feel free to use the above code anywhere you want.Any new ideas or helps feel free to use the comment box. 



articles Info How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java finished in discussion

hopefully the information we convey about Info How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java can benefit you in getting new knowledge about technology,

you just finished reading the information Info How to solve the ListView scrolling problem inside ScrollView as a parent in Android Java we hope this informmation can answer the question you submit to googlle, if you want to bookmark or share please use link https://moymoycikukecik.blogspot.com/2015/04/info-how-to-solve-listview-scrolling.html and do not forget to always visit this blog to get the latest information every day.

Tag :
Share on Facebook
Share on Twitter
Share on Google+
Tags :

0 komentar:

Posting Komentar