15951

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

Question:

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! :)

Answer1:

You should use a <a href="http://developer.android.com/reference/android/text/TextWatcher.html" rel="nofollow">TextWatcher</a> to watch for changes and do whatever you want on afterTextChanged().

Recommend

  • Logging user actions on ASP.NET site?
  • Android Studio onClick button to display ImageView in another activity
  • How can I know which element fire the event from js?
  • Upload multiple files at once using GWT
  • What is wrong with this emulation of CMPXCHG16B instruction?
  • Update Search Results to Lazy Adapter in android
  • How do I translate LR(1) Parse into a Abstract syntax tree?
  • Android onKey w/ virtual keyboard
  • Can my PDF ping my server when it is opened?
  • Two Tables Serving as one Model in Rails
  • C#: Import/Export Settings into/from a File
  • Cast between interfaces whose interface signatures are same
  • Approximate Order-Preserving Huffman Code
  • How Lists (specifically, RecyclerView with CardViews) in Android work
  • Play WS (2.2.1): post/put large request
  • Alert pop up with LWUIT
  • C++ Partial template specialization - design simplification
  • Javascript simulate pressing enter in input box
  • Deserializing XML into class C#
  • htaccess rewriting URLs with multiple forward slashes
  • How to set my toolbar fixed while scrolling android
  • Display Images one by one with next and previous functionality
  • Web-crawler for facebook in python
  • SVN: Merging two branches together
  • Is there a mandatory requirement to switch app.yaml?
  • VB.net deserialize, JSON Conversion from type 'Dictionary(Of String,Object)' to type '
  • A cron job substitute?
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Angular 2 constructor injection vs direct access
  • How do I configure my settings file to work with unit tests?
  • Java static initializers and reflection
  • Android Google Maps API OnLocationChanged only called once
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • Authorize attributes not working in MVC 4
  • Busy indicator not showing up in wpf window [duplicate]
  • Binding checkboxes to object values in AngularJs
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS
  • Python/Django TangoWithDjango Models and Databases
  • Net Present Value in Excel for Grouped Recurring CF