• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Arraylist

sitav1kat

Lurker
Aug 30, 2010
1
0
Hi.sry I am so newbie and I try to make a list, where I can add and delete items by clicking on the button.

I know that I have to make arraylist or something, but how I have to start that code.


In this kind of list , I cant add and delete them, right?


public class NewList extends Activity {
private ListView lView;
private String lv_items[] = { "kala", "juust", "vorst" };

@Override public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
lView = (ListView) findViewById(R.id.ListView01);
// Set option as Multiple Choice. So that user can able to select more the one option from list
lView.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_multiple_choice, lv_items));
lView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
}
}
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones