本文介绍了在spinner,textview中显示数据库中的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从数据库中检索信息并将其显示在textview&微调器?以下是我的主要活动代码
How to retrieve information from database and display it in textview & spinner? Below is my codes for my main activity
private void displayCurrentNearableInfo() {
Desc = (TextView) findViewById(R.id.textview1); //for description
// Get reference of SpinnerView from layout/nearable_demo.xml
spinnerDropDown = (Spinner) findViewById(R.id.spinner1); //For size available
spinnerDropDown2 = (Spinner) findViewById(R.id.spinner2);//for colours available
COO = (TextView) findViewById(R.id.textview2);//for country of origin
SM = (TextView) findViewById(R.id.textview3); //for shoe model
Price = (TextView) findViewById(R.id.textview4); //for price
stickerdb = new Database_sticker(this);
dbRow = stickerdb.getResult(currentNearable.identifier);
dbRow.getDesc();
dbRow.getSa();
dbRow.getCa();
dbRow.getCoo();
dbRow.getSm();
dbRow.getPrice();
}
推荐答案
这篇关于在spinner,textview中显示数据库中的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!