开发者

Android app that opens inbox SMS

开发者 https://www.devze.com 2023-03-26 18:00 出处:网络
I am using an SMS manager in my app, so when a button is clicked, an SMS is sent, btnPaket.setOnClickListener(new View.OnClickListener()

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消