CopyPastor

Detecting plagiarism made easy.

Score: 0.8697672250658967; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2015-05-19
by Narendra Singh

Original Post

Original - Posted on 2015-05-15
by Narendra Singh



            
Present in both answers; Present only in the new answer; Present only in the old answer;

**The reason behind that it - Your listview is inside ScrollView**
*Do as following to fix your trouble -*

ListView lv = (ListView)findViewById(R.id.landHoldingList); // your listview inside scrollview lv.setOnTouchListener(new ListView.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: // Disallow ScrollView to intercept touch events. v.getParent().requestDisallowInterceptTouchEvent(true); break; case MotionEvent.ACTION_UP: // Allow ScrollView to intercept touch events. v.getParent().requestDisallowInterceptTouchEvent(false); break; } // Handle ListView touch events. v.onTouchEvent(event); return true; } });

What this does is disable the TouchEvents on the `ScrollView` and make the `ListView` intercept them. It is simple and works all the time.

**Also remove `ScrollView` from `ListView` data.**
**The reason behind that it - Your listview is inside ScrollView**
*Do as following to fix your trouble -*
ListView lv = (ListView)findViewById(R.id.landHoldingList); // your listview inside scrollview lv.setOnTouchListener(new ListView.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: // Disallow ScrollView to intercept touch events. v.getParent().requestDisallowInterceptTouchEvent(true); break; case MotionEvent.ACTION_UP: // Allow ScrollView to intercept touch events. v.getParent().requestDisallowInterceptTouchEvent(false); break; } // Handle ListView touch events. v.onTouchEvent(event); return true; } });
What this does is disable the TouchEvents on the ScrollView and make the ListView intercept them. It is simple and works all the time.

        
Present in both answers; Present only in the new answer; Present only in the old answer;