android - Dynamic "where" in custom ParseQueryAdapter -
i'm using parse.com framework populate listview. adapter looks this:
public itemsqueryadapter(context context) { super(context, new parsequeryadapter.queryfactory<parseobject>() { public parsequery create() { parsequery query = parsequery.getquery("item"); latlngbounds latlngbounds = new latlngbounds.builder(). include(sphericalutil.computeoffset(currentlatlng, currentradius, 0)). include(sphericalutil.computeoffset(currentlatlng, currentradius, 90)). include(sphericalutil.computeoffset(currentlatlng, currentradius, 180)). include(sphericalutil.computeoffset(currentlatlng, currentradius, 270)).build(); itemsquery.wherewithingeobox("location", new parsegeopoint(latlngbounds.southwest.latitude, latlngbounds.southwest.longitude), new parsegeopoint(latlngbounds.northeast.latitude, latlngbounds.northeast.longitude)); itemsquery.orderbydescending("createdat"); itemsquery.include("user"); return itemsquery; } }); }
and listview being populated this:
itemsqueryadapter = new itemsqueryadapter(getactivity()); listview listview = (listview) getview().findviewbyid(r.id.lvitems); listview.setadapter(itemsqueryadapter); itemsqueryadapter.loadobjects();
the problem have inside custom adapter, both currentlatlng , currentradius can change , therefore need dynamically "loaded" on each loadobjects() do. there way this?
regards, d.
Comments
Post a Comment