But when testing on a real device, it does not respond, when an SMS arrives at the device, it does not send SMS to the specified number,

Clarity gradually comes, the fact is that I tested on emulators version 2.3.3, and now when I installed my program on emulator version 4.3, it stopped working even in the emulator, what thoughts would be.

  • Try to start by specifying the sentIntent parameter when calling and check the resultCode for the incoming Intent 'and in BroadcastReceiver ' e. - falstaf
  • For example [sic] [1]. [1]: pastebin.com/7Psuzhsy - falstaf
  • You surely don’t blame me, but in my new project my getApplicationContext () and registerReceiver are underlined in red with a red one that doesn’t go to Nehru. Do not take it for arrogance can you send me a working code. When you receive an SMS on the phone, he must send his SMS to another number. Or you can give the link where it is implemented. And then I did a week testing this project on an emulator, and when it came to a real phone, everything was covered. I will not be in debt. - FFFNikolay
  • one
    Adapted to work from BroadcastReceiver 'a. [Tyk] [1]. [1]: pastebin.com/xdYk2mjc - falstaf
  • 1) Show the receiver's declaration in the manifest. 2) What version of Android are you writing for? The way to intercept SMS depends on these 2 circumstances. - Barmaley

1 answer 1

@FFFNikolay learn how to first correctly declare a BroadcastReceiver - google something and then ask 4 questions on almost the same topic.