호출 시스템 메일, 문자, 전화, 브라우저

1873 단어 메일을 보내다

1. 메일 보내기
	/**
	 *  , 
	 * */
	public void sendEmail(String email)
	{
		Intent intent = new Intent(Intent.ACTION_SEND);
		intent.setType("plain/text");// !
		intent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{email + ""});// String , String, 

		startActivity(Intent.createChooser(intent, " ?"));

	}

 
2. 문자 보내기
/**
	 *  
	 * 
	 * */
	private void sendSms() {		
		Uri smsToUri = Uri.parse("smsto:" + phoneNumber);
		Intent mIntent = new Intent(android.content.Intent.ACTION_SENDTO, smsToUri);
		mIntent.putExtra("sms_body", smsContent);
		startActivity(mIntent);
	}
 
 
3. 전화하기
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));// 
						
						startActivity(intent);
 
4. 브라우저
/**
	 *  
	 * */
	public void callExplorer(String url)
	{
		try{
			Uri uri = Uri.parse(url); //url , : http://, catch 
			Intent intent = new Intent(Intent.ACTION_VIEW, uri);
			startActivity(intent);
		}catch(ActivityNotFoundException e){
			ShowToast.show(this," , , ~");
		}
		
	}
 
 
 
 
권한:
 
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.SEND_SMS" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
 
 
 
 
 
 
 
 

좋은 웹페이지 즐겨찾기