android - Making listview move to last item position -


am trying make listview move last item when new items added view. textview achieve doing

layout layout = myview.getlayout();         if(layout != null){             int scrolldelta = layout.getlinebottom(myview.getlinecount() - 1)                  - myview.getscrolly() - myview.getheight();             if(scrolldelta > 0)                 myview.scrollby(0, scrolldelta);         } 

but listview adapter, can't seem figure out method call. adapter setup

myview = (listview) findviewbyid(r.id.myview_list); myadapter = new arrayadapter<>(this, r.layout.list, entries); myview.setadapter(myadapter); 

use smoothscrolltoposition(int position). scroll listview passed in element on screen. if don't know number of items, use listview.smoothscrolltoposition(adapter.getcount());


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -