달력

82025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

'Activity'에 해당되는 글 1건

  1. 2015.01.29 [android]다른 프로젝트의 Activity 불러오기

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
Posted by 초코렛과자
|