java - Android ListView with active and inactive entries -


i need listview has several clickable entries. however, of them inactive until asynctask releases them. how should best this? first thought of having seperate arraylist booleans seems somehow cheap. there way expand stablearrayadapter?

this current adapter

import android.content.context; import android.widget.arrayadapter;  import java.util.hashmap; import java.util.list;  public class stablearrayadapter extends arrayadapter<string> {          hashmap<string, integer> midmap = new hashmap<>();          public stablearrayadapter(context context, int textviewresourceid,                                   list<string> objects) {             super(context, textviewresourceid, objects);             (int = 0; < objects.size(); ++i) {                 midmap.put(objects.get(i), i);             }         }          @override         public long getitemid(int position) {             string item = getitem(position);             return midmap.get(item);         }          @override         public boolean hasstableids() {             return true;         } } 

override isenabled() in adapter. can return false items should not clickable @ first. when asynctask completes, in onpostexecute() can call other method define on adapter enable items, point on isenabled() implementation should return true items.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -