Populate EditText with value from database
问题 In my Android application I have a TextView with an EditText. I want to prepopulate the EditText with the last value entered, which is stored in the SQLite database? 回答1: This should not be so hard I think: public void onCreate(Bundle savedState) { EditText editText = (EditText) findViewById(R.id.my_edittext); String value = // Query your 'last value'. editText.setText(value); } If you want to learn more about SQLite database storage, read this article in Android document. 回答2: Assign an