在spinner,textview中显示数据库中的信息 [英] Displaying information from database in spinner, textview

查看:69
本文介绍了在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();
    }

推荐答案

在下面的教程中,将介绍如何从SQLite数据库填充微调器数据。

Android填充SQLite数据库中的Spinner数据 [ ^ ]



为您带来很多结果: Google [ ^ ] :)

我将第一个链接作为您查询的解决方案,您也应该使用 Google [ ^ ]有时。



-KR
In this following tutorial it is explained how to populate spinner data from SQLite Database.
Android Populating Spinner data from SQLite Database[^]

And much for result for you: Google[^] :)
I go the very first link as a solution for your query, you too should use Google[^] sometimes.

-KR


这篇关于在spinner,textview中显示数据库中的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆