Guest User

Untitled

a guest
Feb 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. BaseAdapter.notifyDataSetChanged();
  2. mScroller.startScroll(oldX, 0, dx, 0);
  3.  
  4. BaseAdapter.notifyDataSetChanged();
  5. new Handler().postDelayed(new Runnable() {
  6. @Override
  7. public void run() {
  8. mScroller.startScroll(oldX, 0, dx, 0);
  9. //write scroll code here
  10. }
  11. },50); //scroll after 50ms
  12.  
  13. @Override
  14. public void notifyDataSetChanged()
  15. {
  16. super.notifyDataSetChanged();
  17.  
  18. parentGlobal.setSelection(this.getCount() - 1); //This is how we start Activity fully scrolled to bottom
  19. }
  20.  
  21. lv_main = (ListView) findViewById(R.id.listView_conversation);
  22. adapter_main = new Adapter_Conversation(ConversationActivity.this, R.layout.layout_list_conversation,
  23. list_main_UI, lv_main, main_list_item_margin_px);
  24. lv_main.setAdapter(adapter_main);
  25.  
  26. public Adapter_Conversation(AppCompatActivity activity, @LayoutRes int resource,
  27. ArrayList<Adapter_GetSet_Conversation> list_conversation, ListView lv_main,
  28. int item_margin_px)
Add Comment
Please, Sign In to add comment