0

How is best method to append or prepend ListView ?

A starting point is this tutorial.

http://www.androidbegin.com/tutorial/android-parse-com-listview-load-more-using-onscrolllistener-tutorial/

    adapter = new ListViewAdapter(MainActivity.this, numberlist);

// Binds the Adapter to the ListView listview.setAdapter(adapter);

But i think this method is reloading the list.

There are other ways of implementing or it would be best?

Valy Dvweb
  • 35
  • 8

1 Answers1

0

i think thats the best way to pupulate listview and setAdapter is not for reloading the list that is to Sets the data behind this ListView

notiftDataSetChanged() method is to reload the list if you update the list.

one more thing if you want to use custome layout for your list then what your are doing is the best way but if you want to use default layout that android provides then

ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
          android.R.layout.simple_list_item_1, android.R.id.text1, values);  
      // Assign adapter to ListView
        listView.setAdapter(adapter); 
Moubeen Farooq Khan
  • 2,875
  • 1
  • 11
  • 26