I have one activity having table view in it. I dynamically generates a table with togglebutton in each row. Now,when user taps this button to switch it on whole table should get refreshed so that if user wants that button to switch off again then it should switch off when tapped again. For this I recall an activity after finishing it but it's scroll position comes to first row again. And I want scroll position similar as it was before tapping the toggle button. Thank You.
Asked
Active
Viewed 278 times
1
-
when recalling the activity pass the scroll position as an intent extra and in onCreate check whether an extra is provided or not. if provided, scroll to that position via code – Abhishek Nandi Apr 08 '13 at 13:08
-
Your suggestion is too good. But, I tried this thing using onPause() & onResume(). Here the problem is it first sends actual scroll value secondly sends zero,again third time actual value & so on. wht to do now? – TechHelper Apr 08 '13 at 13:29
-
@Atrix1987 : I understood the problem that when first time it gets actual position it scrolls & keeps that table row at the top by clipping upper part & second time it gets position of this row as 0. But, I don't know how to solve this problem? Please help. – TechHelper Apr 08 '13 at 13:37
-
To solve this problem upper layout part should not not get clipped after calling scrollTo(). But,how to prevent it from clipping? Please help. – TechHelper Apr 08 '13 at 13:49
-
attach an image of what u want and what issue u r facing, i am nt able to visualize ur issue – Abhishek Nandi Apr 08 '13 at 15:40
-
As per your 1st commnt,after restartng activity & invokng scrollto() method clips the part above that scroll position. so how to prevent it from clipping that part? – TechHelper Apr 09 '13 at 18:32
-
u are scrolling more, scrollto value will be a bit less than what u r providing – Abhishek Nandi Apr 10 '13 at 06:30
-
Provide any value to scrollTo(); it always clips the part above that scroll position. I want to maintain same scrolled layout even after restarting activity.Please help people. Thank You. – TechHelper Apr 11 '13 at 08:41