ANDROID

intent 를 활용한 전화,문자 보내기창 띄우기

지니 2017. 1. 12. 15:22
반응형




http://theeye.pe.kr/archives/1242




ex))


@JavascriptInterface
public void SendSMSPopup(final String Msg) {
Intent it = new Intent(Intent.ACTION_VIEW);
//it.putExtra("address", "전화번호");
it.putExtra("sms_body", Msg);
it.setType("vnd.android-dir/mms-sms");
startActivity(it);
}



@JavascriptInterface
public void SendMAILPopup(final String Msg) {
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra(Intent.EXTRA_EMAIL, "");
it.putExtra(Intent.EXTRA_SUBJECT, "제목");
it.putExtra(Intent.EXTRA_TEXT, Msg);
it.setType("text/plain");
startActivity(Intent.createChooser(it, "Choose Email Client"));

}


// MMS 발송
Uri uri = Uri.parse("file:///storage/emulated/0/screenshot.png");
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra("subject", "신용카드 취소내역");
it.putExtra("sms_body", "카드취소내역 입니다.");
it.putExtra(Intent.EXTRA_STREAM, uri);
it.setType("image/png");
startActivity(it);


반응형