0

I am making an app in which I will send a 4-digit verification code to the user by sms.. Then a dialog will open where the user has to enter the code. I want that when the sms comes, the 4 digit code automatically gets entered in the edit text. I can do it if I can read the message body of the new incoming messages, I did the code but it's not working.

I tried this and this solution.. But it did not work for me.. I am using Xiomi Redmi 1s android device and many times, there are codes which do not run on my device but run on other devices perfectly.. So please suggest any solutions.. Thanks in advance

Community
  • 1
  • 1
Prakhar
  • 710
  • 6
  • 24
  • Xiaomi phones block other sms apps to recive sms. You can turn that off in the settings. But you should make a timed runnable that periodically checks smses, since they made such a smart a.. move – Bojan Kseneman Apr 27 '15 at 10:20
  • In your case.. Check if Device Manufacturer is Xiaomi, If true, then just read SMS, copy code and set it to your desired EditText. – Ankit Kumar Apr 27 '15 at 10:28
  • Actually I stand correct, it's not only their phones, it's every phone with xiaomi(miui) roms installed. I ended up listening in a receiver in combination with a handler that keeps posting a delayed runnable every few seconds to read the sms. – Bojan Kseneman Apr 27 '15 at 11:42

0 Answers0