从数据库中获取数据,并设置它的EditText [英] fetching data from database and set it on edittext

查看:949
本文介绍了从数据库中获取数据,并设置它的EditText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做一个注册页面我application.For这一点,我需要插入的注册信息中的SQLite DB.Once登记完成后,领域的EditText应显示这些细节,从数据库中获取并提交按钮和文本田应禁用从第二次停止registration.Can有人建议合适的方式?

I am doing a registration page for my application.For this I need to insert the registration details in to sqlite DB.Once the registration is done,the edittext fields should display those details fetching it from database and the submit button and text fields should be disabled to stop from a second time registration.Can anyone suggest the suitable way?

推荐答案

检查code在以下链接的 Android的SQLite的

Check code for database in the following link Android SQLite

您必须存储在ArrayList中的价值,这是从数据库reterived和值设置为编辑文本

you have to store the value in arraylist and which is reterived from database and set the value to the edit text as

 editText.setText(myarraylist.get(0)); //here myarraylist is the arraylist which contains data retrive from database

数据reterived

在你要检查车况是否editText.getText()。的toString()长度大于零不应该让他们通过编辑EDITTEXT在后面的文字

After the data is reterived you have to check the condition whether editText.getText().toString() length is greater then zero you should not allow them to edit the text in editText by using following

  editText.setFocusable(false);

这篇关于从数据库中获取数据,并设置它的EditText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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