Android Question scrollview problem

eades

Member
Licensed User
Longtime User
i have several ultimatelistviews in a scrollview but i can't use de scroll function in the selected ultimatelistview because when i try to scroll the scrollview scrolls.
setting the enabled function from the scrollview to false in the celltouch event wo'nt work.
On the internet i have found some java code to do this but how do i implement this in b4a
Can someone help me with this?
the java code is:
====================================
ListView lv =(ListView) findViewById(R.id.layout_lv);
lv.setOnTouchListener(newOnTouchListener(){// Setting on Touch Listener for handling the touch inside ScrollView@Overridepublicboolean onTouch(View v,MotionEventevent){// Disallow the touch request for parent scroll on touch of child view
v.getParent().requestDisallowInterceptTouchEvent(true);returnfalse;}});
====================================
My ultimate listview is called ULV_1
Thanks in advance.
PS sorry for my bad english, i am Dutch.

ok i have found the solution
=======================
Sub ULV_1_CellTouch (CellIndex As Byte, Position As Int, Action As Int, X As Int, Y As Int, TouchedPanel As Panel)
Dim r As Reflector
r.Target = Materiaal_scroll ' the scrollview
r.RunMethod2("requestDisallowInterceptTouchEvent", True, "java.lang.boolean")
End Sub
========================
Now the scroll function in the ultimate listview works perfect and the scrollview works to.
 
Last edited:
Top