A라는 App에서 B라는 App를 실행하고 싶을 때 사용하는 예제
A.java
Intent intent = new Intent();
intent.setClassName("com.example", "com.example.MainActivity");
startActivity(intent);
com.example에는 B프로젝트의 MainActivity가 있는 package 명을.
com.example.MainActivity 에는 MainActivity까지의 입력하면 된다.
여기에 값을 넘기고 싶으면, intent.putextra("key", "value"); 를 통해서
이건 일반적인 intent에서 값을 넘기는 것과 같다.
'android' 카테고리의 다른 글
[android] Screenshot 기능 넣기 (0) | 2016.01.31 |
---|---|
[android] switch vs if else (0) | 2015.01.29 |
[android]URL ImageView 생성 (0) | 2015.01.27 |
[android]AlertDialog ListView 예제 (0) | 2015.01.20 |
[android]URL을 통한 Image 받아오기 (0) | 2015.01.19 |