Android : How to show loading icon on scrolling in android without using listview

on Monday, January 19, 2015


I have Scroll view as a parent and four text view inside scroll view. I am adding data to these text view from my view class. say 15 times.now this will look like a scrolling list when i launch my app. my question is if i want to show loading symbol after say 10 items , how one can show this? Hare i am not using list view.Its just one XML and adding data externally through loop. any one know trick?


My code is some how like this- 1) textviews.xml



<ScrollView>

<TextView1/>
<TextView2/>
<TextView3/>
<TextView4/>


</ScrollView>


2) Viewclass.java



Viewclass extends scrollview{

for(int i=0;i<15;i++){

View v=inflate textviews.xml;

Textview1=(TectView)v.findviewbyid(R.id.textview1);
Textview2=(TectView)v.findviewbyid(R.id.textview2);
Textview3=(TectView)v.findviewbyid(R.id.textview3);
Textview4=(TectView)v.findviewbyid(R.id.textview4);

Textview1.setText("Hello1");
Textview2.setText("Hello2");
Textview3.setText("Hello3");
Textview4.setText("Hello4");
addView(v);
}
}


in above case how can i show loading icon after 7th element. Thanks a lot in advance!!


0 comments:

Post a Comment