How do I add an “edittext” that when you type in a specific word an action happens

落爺英雄遲暮 提交于 2020-01-07 02:44:10

问题


How do I add a "edittext" that when you type in a specific word such as "apple" it will make a new xml page pop up. But if the user types in a different word besides "apple" it will make a different xml page pop up.

What I'm trying to accomplish is somethings similar to a logo quiz game where when you type in the right word, a new thing pops up.

I have absolutely no idea how to do it. if u could show me a video on how to do it, that would be very helpful thanks! :)


回答1:


You should use a TextWatcher to watch for changes and do whatever you want on afterTextChanged().



来源:https://stackoverflow.com/questions/15604595/how-do-i-add-an-edittext-that-when-you-type-in-a-specific-word-an-action-happe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!