Android Edittext listviews? -


I'm scratching the Internet to use an input box at the top of the page, and an add and a; Remove button.

I want to write EditText on ListView , which in turn writes a list to .txt -file.

I tried to break it down into several small pieces of simple things like below

  • Get input from EditText TextView < Post to / code>.
  • A ListView
  • Write a file and read
  • A file to read.

    If you have any advice about going from ListView to EditText then it is very helpful.

    The best way to do this is by a ArrayList & lt; String & gt; To store your strings with textview, and in return ArrayList & lt; String & gt; feed is ListView . For example, for your add button handler:

      // Announce our variable ArrayList & lt; String & gt; MyStringList = New Array List & lt; String & gt; (); // AddClickListener for Add stuff button .. myStringList.add (myEditText.getText (.) ToString ()); MyListView.setListAdapter (new array adapter & lt; string & gt; (getBaseContext (), android.R.layout.simple_list_item_1, myStringList); .. // Close OnClickListener Luggage   

    Make sure that you refresh your list adapter later to show new values. Similarly if you want to delete, then that string is from the list. Use myStringList.remove (index) to remove and refresh the array adapter. To write a text file, take a look at

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -