0

I have list of elements in scroll view. When clicking the element, I need to load data from server and inflate it in the clicked view. The data I fetch from server has variable heights. So I cannot fix the view height.

My problem is,

1- I click a view to fetch data.

2- I will be showing progressbar during server fetch.

3- I scroll down to view other data. In the mean time, if the the server fetch is success I will set the data. It will automatically adjust the scrollview. Since the scroll height is changed, the data I am viewing suddenly scrolls down.

I need to lock the scroll to the content I am viewing. I tried this solution, Stop ScrollView from setting focus on EditText but this is not working during scroll.

Pleas advice. Thanks in advance.

Community
  • 1
  • 1
arul
  • 190
  • 2
  • 15
  • If you have dynamic content content in your view then why you not using list view? – EEJ Aug 12 '15 at 12:00
  • In listview too there will be similar issue. Moreover I have multiple webiviews in the view which caused me loading/flickering issues – arul Aug 12 '15 at 12:03
  • So u mean u having diffrent webview inside scroll view redirecting to different url? – EEJ Aug 12 '15 at 12:06
  • yes. i will show progressbar of fixed height during loading – arul Aug 12 '15 at 12:08
  • 1
    Then you must use list view....and post the url which you trying load...i will check that whether it is still flickering with list view or not – EEJ Aug 12 '15 at 12:11
  • Or if you already tried with list view then share the code of adapter...and tell how u adding and updating the adapter – EEJ Aug 12 '15 at 12:12
  • I will be fetching html content and load content through javascript. I do not want to recycle the view. So I switched to scroll view – arul Aug 12 '15 at 12:15
  • Ohhh...then i think you should share your code...then only i can proposed some other some solutions – EEJ Aug 12 '15 at 13:06
  • I have shared a demo code explaining my scenario -> https://drive.google.com/file/d/0B0tVlqj4uamAd3A0Q2FPd0xXOXc/view?usp=sharing . – arul Aug 12 '15 at 15:05

0 Answers0