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
Post a Comment