1. 연락처로 이동
void selectContact(){
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
startActivity(intent);
}
2. 웹브라우저
void openWebPage(String url){
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW,uri);
startActivity(intent);
}
3.SMS 앱
// SMS 보내기위한 액티비티 띄우기
void composeSMS(String phone){
Uri uri = Uri.parse("smsto:"+phone);
Intent intent = new Intent(Intent.ACTION_VIEW,uri);
startActivity(intent);
}
4. 이메일
void composeEmail(String[] address,String subject){
Uri uri = Uri.parse("mailto:");
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(uri);
intent.putExtra(Intent.EXTRA_EMAIL,address);
intent.putExtra(Intent.EXTRA_SUBJECT,subject);
startActivity(intent);
}
'개발 > 안드로이드' 카테고리의 다른 글
Android - https 통신을 위한 Retrofit 라이브러리 (0) | 2023.02.09 |
---|---|
Android - RecyclerView 페이징처리 (0) | 2023.02.08 |
Android - Image Url로 화면에 표시 (0) | 2023.02.07 |
Android - Floationg Action Button (0) | 2023.02.06 |
Android - ActionBar (0) | 2023.02.06 |