初学Android,在注册页面遇到的一个bug

本文探讨了在使用字母作为用户名进行注册时遇到的问题,即应用程序崩溃并出现数据库连接泄漏的错误提示。通过检查发现未对字母字段正确引用是导致问题的原因。

        用阿拉伯数字注册用户时是可以成功的,但是使用字母注册的时候问题就出现了。只要是以字母为用户名,在点击注册的时候程序就崩溃了。查看logcat,说是在插入数据库表的时候没有找到该字段,并且报了以下错误:

database '/data/user/0/com.google.android.gms/databases/metrics.db.16' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.

08-04 01:28:04.349 2740-2747/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/help_responses.db.18' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.

08-04 01:28:04.350 2740-2747/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/auto_complete_suggestions.db' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed. 

捣鼓了好久 在表哥的指点下才发现是这里没有加引号导致程序不能识别注册时输入的是什么。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值