버튼 클릭 Intent ACTION_VIEW Uri.parse 코드를 함수로 생성하였다.
연락처 선택하는 액티비티 띄우기
// 연락처 선택하는 액티비티 띄우기
void selectContact(){
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
startActivity(intent);
}
웹브라우저 실행시키는 인텐트
// 웹브라우저 실행시키는 인텐트
void openWebPage(String url){
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
SMS 보내기위한 액티비티 띄우기
// SMS 보내기위한 액티비티 띄우기
void composeSMS(String phone){
Uri uri = Uri.parse("smsto:"+phone);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
이메일 작성하는 액티비티 띄우기
// 이메일 작성하는 액티비티 띄우기
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' 카테고리의 다른 글
| recyclerView - 리사이클러뷰 페이징 처리 (0) | 2023.02.08 |
|---|---|
| 안드로이드 키보드가 활성화 되면 화면이 밀려 올라가는 현상 해결 코드 (0) | 2023.02.08 |
| 상단바 (Action bar) 에 옵션 메뉴 구현하기 (0) | 2023.02.07 |
| 이미지 처리를 위한 Glide 라이브러리 사용법 (0) | 2023.02.07 |
| 네트워크로부터 받은 Json 데이터에서, json 의 array 를 RecyclerView 로 처리 (0) | 2023.02.03 |