android - Disable loading spinner when listview content is loaded -


i have code listview:

@override         public void oncomplete(list<profile> friends) {              // populate list             list<string> values = new arraylist<string>();             (profile profile : friends) {                 //profile.getinstalled();                 values.add(profile.getname());                       }              arrayadapter<string> friendslistadapter = new arrayadapter<string>(getapplicationcontext(), r.layout.list_items2, values);             friendslistadapter.sort(new comparator<string>() {                 @override                 public int compare(string lhs, string rhs) {                     return lhs.compareto(rhs);                     }             }); 

and custom spinner animation:

<imageview     android:id="@+id/imagespinner"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_centerhorizontal="true"     android:layout_centervertical="true"     android:src="@drawable/custom_spinner2" /> 

the listview loads content facebook, , when content done loading want spinner disappear, have spinner there when content loaded. have tried adding oncomplete method:

runonuithread(new runnable() {                 @override                 public void run() {                     mspinner.setvisibility(view.gone);                 }                 }); 

but code spinner still there when content loaded, ideas wrong code?

i solved adding clearanimation(); right after setvisibility(view.gone);, this:

runonuithread(new runnable() {                 @override                 public void run() {                     mspinner.setvisibility(view.gone);                     mspinner.clearanimation();                 }                 }); 

now works perfectly!

i'm guessing happens because animation running always. hide animation on runonuithread. or use default progressbar.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -