• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Send SMS to most recent caller

ibwev

Lurker
I have developed an app that creates predefined messages. I use the following code to open the users default texting app with the body of the text predefined:

Java:
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse("smsto:"));  // This ensures only SMS apps respond
        intent.putExtra("sms_body", textStr);
        if (intent.resolveActivity(getPackageManager()) != null) {
            startActivity(intent);
        }

Is it possible to open the user's default texting app with the user's most recent calls received displayed? Users of my app would find it desirable to select one of the most recent phone calls with which to send a predefined text. My current workaround is to require a recent caller to text the user.
 
Thank you for replying. Sending a predefined text to most recent caller is a small component of the app I am developing; therefore, I would like to avoid using another application to satisfy this feature. Is it possible to prompt the user to send a predefined text to most recent caller using an Intent or something like it. Is there a library in Java that may allow for this type of functionality? The closest desired feature I have been able to find is the use of Intents (https://developer.android.com/guide/components/intents-common.html#Messaging). The only problem is that using an Intent to send text opens the users default texting application with the contacts most recently texted displayed. I am trying to allow the user to send a text to the contact that has most recently called.
 
Back
Top Bottom