Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to save the instance in an edittext?
    primarykey
    data
    text
    <p>I'm creating an application for my school, and one activity in it is the notes-section. You'll be able to enter your notes, and when you leave the activity notes the app should save the instance (so the notes the user has put in), and when the activity is loaded again the instance should be loaded so that the user can view it and edit it. My code is:</p> <pre><code> package me.menno.Ghlyceum; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; public class Notes extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.notes); } public boolean onCreateOptionsMenu(Menu menu) { // TODO Auto-generated method stub menu.add("Uitval"); menu.add("Notities"); menu.add("Help"); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { String title = item.getTitle().toString(); if (title.equals("Uitval")) { Intent intent = new Intent(this, MainActivity.class); startActivity(intent); } else if (title.equals("Notities")) { Intent intent = new Intent(this, Notes.class); startActivity(intent); } else if (title.equals("Help")) { Intent intent = new Intent(this, Help.class); startActivity(intent); } return true; } </code></pre> <p>Could you please help me by saying where I should include the oncreate and saveinstance or something? I'm absolutely an beginner in Android, so if you could help me, would be great!</p> <p>Thanks a lot, </p> <p>Menno</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload