Efficientway to Save/load List items to text file android
<p>Hi All does anyone have a Efficient way to Save and load  list view array items to a text file 
how would you integrate  save and load into this code ?</p>

<p>I have some direction for example for save to text.</p>

<pre><code>         File f = File.createTempFile("file", ".txt",Environment.getExternalStorageDirectory ());
        FileWriter fw = new FileWriter(f);
        fw.write(m_listItems);
        fw.close();
</code></pre>

<p>All i want to do is have the ability save and load the list items that i add to the listview  Any help would be much appreciated . I'm lost.</p>

<p>thanking you guys in advance.</p>

<pre><code>public class ListtestActivity extends Activity {
ArrayAdapter&lt;String&gt; m_adapter;
ArrayList&lt;String&gt; m_listItems = new ArrayList&lt;String&gt;();


Button bt;
Button save;
Button Loadtxt;
EditText et;
TextView tv;
ListView lv;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
 save = (Button) findViewById(R.id.button2);
Loadtxt = (Button) findViewById(R.id.button3);
bt = (Button) findViewById(R.id.button1);
et = (EditText) findViewById(R.id.editText1);
tv = (TextView) findViewById(R.id.textView1);
lv = (ListView) findViewById(R.id.listView1);
m_adapter = new ArrayAdapter&lt;String&gt;   (this,android.R.layout.simple_list_item_1, m_listItems);

 lv.setAdapter(m_adapter);
final String input = et.getText().toString();

bt.setOnClickListener(new View.OnClickListener() {

public void onClick(View v) {

    String input = et.getText().toString();
    if(null!=input&amp;&amp;input.length()&gt;0){     

    m_listItems.add(input);

    m_adapter.notifyDataSetChanged();

  }

save.setOnClickListener(new View.OnClickListener() {

public void onClick(View v) {



  }

 Loadtxt.setOnClickListener(new View.OnClickListener() {

public void onClick(View v) {



 }
}
});
</code></pre>