大佬教程收集整理的这篇文章主要介绍了如何从android中的用户获取输入,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Edit@R_234_3801@ = (EditText)findViewById(R.id.EditText01); String abc= text .getText().toString(); while( !(abC).equals("bye")){ abc = text.getText().toString();//user should enter the text from keyboard and the while loop should go and chech the condition.but not able to enter the text //do some operation with abc }@H_404_5@如何让用户输入文本?UI应该等待输入文本(类似于我们在java应用程序中有InputStreamReader).
final EditText ET = (EditText) findViewById(R.id.enterText); Button B1 = (Button) findViewById(R.id.enterButton); B1.setOnClickListener(new View.onClickListener() { public void onClick(View v) { ET.setVisibility(View.INVISIBLE); if(ET.getText().toString() == "BYE") { //do something if it is "BYE" } else { Context context = getApplicationContext(); CharSequence text = "Please enter BYE"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context,text,duration); toast.show(); } ET.setVisibility(View.VISIBLE); } });@H_404_5@
以上是大佬教程为你收集整理的如何从android中的用户获取输入全部内容,希望文章能够帮你解决如何从android中的用户获取输入所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。