-1

I am using an SMS manager in my app, so when a button is clicked, an SMS is sent,

btnPaket.setOnClickListener(new View.OnClickListener()


    {
        public void onClick(View v)
        {
            String phoneNo = "0977";
            String message = "stanje";

            sendSMS(phoneNo, message);

            Toast.makeText(getBaseContext(), "Zahtjev za provjeru stanja paketa je poslan, odgovor ocekuj uskoro!", Toast.LENGTH_SHORT).show();
        }
    });

So when I click on the button, the SMS is sent, and I get an automated response with the state of my SMS, and Internet packets. Is there any way such that a received SMS is automatically opened and shown to the user, without leaving the application, and going to the inbox, or the notifications bar?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Goran
  • 1,239
  • 4
  • 23
  • 36
  • For intercepting incoming SMSes, see [this answer to "Sending and receiving SMSes without a native messaging application"](http://stackoverflow.com/questions/4770853/sending-and-receiving-smses-without-a-native-messaging-application/4771341#4771341) – Peter Mortensen Nov 04 '11 at 17:03

1 Answers1

0

I don't think Android allows you to directly open/read text messages (for extremely obvious reasons...), however, you might be able to just launch the SMS inbox from your application.

Reference here to how to launch activities.

EDIT:
This person apparently found out how to open the sms inbox, check his second post.

René Sackers
  • 2,395
  • 4
  • 24
  • 43
  • Ok, thanks for reply. If i can directly open message, can i show message body in toast ?? – Goran Aug 07 '11 at 18:09