I have a layout that is like this
RelativeLayout
ScrollView
RelativeLayout
TextView
ListView
.....
ExpandableTextView
Button
....
other Listviews
....
Adview
....
ListViews element are loaded by AsyncTask. On button click expandableTextView expands or collapses.
Problem is that when i collapse expandableTextView,the view is not moving up. I've tried scrollTo method,but is not working...
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(...) {
runOnUiThread(new Runnable() {
@Override
public void run() {
final ScrollView sv = (ScrollView) findViewById(R.id.sv);
sv.scrollTo(0,descTxt.getTop());;
}
});
}
else{
}
}
});
I've tried implement above in onCreate
and then in onPostExecute
of asynctask
but nothing happens. Whats going wrong? Thanks!!
Is it possible that is not working because of asynctask or because of that scrollview changes size dynamically according to elements?