Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;
import android.content.Intent;

import android.net.Uri;

public class Main {
    public static void editMessage(Context context, String phoneNumber, String msg) {
        Uri smsToUri = Uri.parse("smsto:" + phoneNumber);
        Intent msgIntent = new Intent(Intent.ACTION_SENDTO, smsToUri);
        msgIntent.putExtra("sms_body", msg);
        context.startActivity(msgIntent);
    }

    public static void editMessage(Context context, String msg) {
        Intent msgIntent = new Intent();
        msgIntent.setAction(Intent.ACTION_SENDTO);
        msgIntent.putExtra("sms_body", msg);
        context.startActivity(msgIntent);
    }
}