检索字段中输入的文本(android帮助)
我有一个Android应用程序用户名字段的代码。我想验证该字段,看看它是否为空。这是我的密码:检索字段中输入的文本(android帮助),android,Android,我有一个Android应用程序用户名字段的代码。我想验证该字段,看看它是否为空。这是我的密码: View a = findViewById(R.id.authentication); (a.toString().equals("")) 我猜您不能使用view来获取用户输入的数据。查看这些字段是否为空的最佳方法是什么?a.toString()并不像您认为的那样 使用TextView a=(TextView)findviewbyd(R.id.authentication);(a.getText()
View a = findViewById(R.id.authentication);
(a.toString().equals(""))
我猜您不能使用view来获取用户输入的数据。查看这些字段是否为空的最佳方法是什么?a.toString()并不像您认为的那样
使用TextView a=(TextView)findviewbyd(R.id.authentication);(a.getText()等于(“”)