android

Intent 사용법

디츠 2020. 2. 1. 13:28

* 기본

Intent intent = new Intent(getApplicationContext(), MenuActivity.class);
startActivity(intent);

* 요청코드 추가

Intent intent = new Intent(getApplicationContext(), MenuActivity.class);
startActivityForResult(intent, 101);

* 전화걸기

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tel:010-1000-1000"));
startActivity(intent);

* 웹접속

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://m.naver.com"));
startActivity(intent);