Profile
Pastes: 71829
Members: 1381

Paste

Plain view | Edit code: here. | Add this to your website. | Report abuse.

Short URL: http://goo.gl/bqz9P

Pasted as Plain Text by ttt on Monday, April 9th, 2012 10:33pm ( 2 years ago )

  1. Use BaseAdapter instead of Array Adapter. you will get getCount method when you extend the unimplemented methods... your logic is same..
  2.  
  3. Initially i=10
  4.  
  5. BaseAdapter structure:
  6. class NamesAdapter extends BaseAdapter{
  7.  
  8. //@Override
  9. public int getCount() {
  10. // TODO Auto-generated method stub
  11. return i;
  12. }
  13.  
  14. //@Override
  15. public Object getItem(int position) {
  16. // TODO Auto-generated method stub
  17. return null;
  18. }
  19.  
  20. //@Override
  21. public long getItemId(int position) {
  22. // TODO Auto-generated method stub
  23. return 0;
  24. }
  25.  
  26. //@Override
  27. public View getView(int pos, View convertView, ViewGroup parent) {
  28. //Your getview logic here
  29. return row;
  30. }
  31.  
  32. }
  33.  
  34.  
  35. And place a button in your xml "Show More".. i have said in my answer for onclick of that button .. do that

Revise this Paste
Child(s): 54314
Your Name:
Code Language:
 
Security Image:
Text seen in Image:
Comments

Nothing has been added as yet. Post a comment.