Tuesday, 1 April 2014

reversing list equipment gives wrong position in getview()

I am unequivocally new in Android.I am stranded to a problem that we have
a adapter.and i have to stock my list in shelter orderbut when a position
is not vibrated as listItems.here is my codepublic PageListAdapter(Context
context) { super(); this.context = context; arr = new
ArrayList(); // FilesInFolder = GetFiles("/sdcard/Download");
filePath = Environment.getExternalStorageDirectory() + "/openedpages/";
record = new File(filePath); if (file.exists()) { filenew =
file.listFiles(); for (int i = 0; i < file.listFiles().length; i++)
{ arr.add(filenew[i].getName()); } }
Collections.reverse(arr);}@Overridepublic View getView(final int position,
View convertView, ViewGroup parent) { if (convertView == null) {
inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowview =
inflater .inflate(R.layout.listelement, parent, false);
pagename = (TextView) rowview.findViewById(R.id.listitem); //
pagename.setText(arr.get(position)); arrnum.add(position);
relapse rowview; } else relapse convertView;}here i vibrated
my arraylist..but a position of listitems are opening as opposing
order.new total vigilant is not removing a position 0.Please assistance me
out.thanks.

No comments:

Post a Comment