我在Android上的EditText中,我希望用戶輸入的條件「再見」如何採取輸入從用戶的Android
代碼示例文本和檢查:
EditText text = (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
}
如何我可以讓用戶輸入文本?? UI應該等待輸入文本(就像我們在Java應用程序中有InputStreamReader一樣)。
進入,但我想從keyboard.its像這樣輸入:我輸入一些文字,然後按Enter,然後同時循環還應當檢查如果輸入的字符串是「BYE」,則終止,否則進入循環並要求我進入反擊直到我進入「再見」 – SPB 2010-09-22 07:49:59