How to retrieve data from sqlite database in android and display it in TextView

后端 未结 5 552
攒了一身酷
攒了一身酷 2020-11-27 07:10

I am learning Android. I have a problem and I can\'t solve it. I want to retrieve data from an existing database and display it in a TextView after click button

5条回答
  •  攒了一身酷
    2020-11-27 07:41

    First cast your Edit text like this:

    TextView tekst = (TextView) findViewById(R.id.editText1);
    tekst.setText(text);
    

    And after that close the DB not befor this line...

     myDataBaseHelper.close(); 
    

提交回复
热议问题