you can use this add line to display on the button
final String a[]={"hello","world"}; final ArrayAdapter<String> at=new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1,a); final ListView sp=(ListView)findViewById(R.id.listView1); sp.setAdapter(at); final EditText et=(EditText)findViewById(R.id.editText1); Button b=(Button)findViewById(R.id.button1); b.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {
So, when you click the button, it will get the line from edittext and save it in the list. You can change it to your needs.
source share