S select Member Licensed User Longtime User Dec 7, 2015 #1 Hello, I've an activity with a listview. When I press an item of listview my app start another activity. With "back" button it come back in the first activity with listview. It's possible, in this moment, highlight the last item pressed of the listview?
Hello, I've an activity with a listview. When I press an item of listview my app start another activity. With "back" button it come back in the first activity with listview. It's possible, in this moment, highlight the last item pressed of the listview?
Erel B4X founder Staff member Licensed User Longtime User Dec 7, 2015 #2 You can use this code to create a persistent highlight: Code: Copy Dim jo As JavaObject = ListView1 Dim cd As ColorDrawable cd.Initialize(Colors.Red, 0) 'change as needed. jo.RunMethod("setChoiceMode", Array(1)) jo.RunMethod("setSelector", Array(cd)) Upvote 0
You can use this code to create a persistent highlight: Code: Copy Dim jo As JavaObject = ListView1 Dim cd As ColorDrawable cd.Initialize(Colors.Red, 0) 'change as needed. jo.RunMethod("setChoiceMode", Array(1)) jo.RunMethod("setSelector", Array(cd))
S select Member Licensed User Longtime User Dec 7, 2015 #3 Thankyou Erel! When I try it say: Code: Copy Parsing code. 0.02 Compiling code. Error Error compiling program. Error description: 'as' expected. Occurred on line: 101 jo.RunMethod("setChoiceMode", Array(1)) Word: ( I probably did not understand how to use your code... Upvote 0
Thankyou Erel! When I try it say: Code: Copy Parsing code. 0.02 Compiling code. Error Error compiling program. Error description: 'as' expected. Occurred on line: 101 jo.RunMethod("setChoiceMode", Array(1)) Word: ( I probably did not understand how to use your code...
stevel05 Expert Licensed User Longtime User Dec 7, 2015 #4 If you are using an older version of B4a, you will need to write Code: Copy jo.RunMethod("setChoiceMode", Array As Object(1)) Upvote 0
If you are using an older version of B4a, you will need to write Code: Copy jo.RunMethod("setChoiceMode", Array As Object(1))