2017-07-15 64 views

回答

0

你可以試試這個

Cursor myCursor = db.rawQuery("SELECT * FROM measurements WHERE _id = 1", null); 
String myEditTextValue = myCursor.getString(*ColumnIndexHere*); 

EditText myEditText= (EditText) findViewById(R.id.*EditTextIdHere*); 
myEditText.setText(myEditTextValue); 

但是請注意,在Android上最好的做法是使用內容提供商。欲知更多詳情,請點擊這裏 https://www.youtube.com/watch?v=CKjFfcFelrI and this https://developer.android.com/guide/topics/providers/content-providers.html

相關問題