다른 응용 프로그램의 활동을 호출하는 하나의 응용 프로그램에서 활동이 있습니다. 의도 또는 다른 방법으로 어떻게 할 수 있습니다. 하나의 응용 프로그램에서 예를 들어, 우리는 그것을 좋아 할 수 있습니다Android에서 응용 프로그램 간 통신
Intent i = new Intent(this, ActivityTwo.class);
i.putExtra("Value1", "This value is sent by FirstActivity ");
다른 응용 프로그램의 활동을 호출하는 하나의 응용 프로그램에서 활동이 있습니다. 의도 또는 다른 방법으로 어떻게 할 수 있습니다. 하나의 응용 프로그램에서 예를 들어, 우리는 그것을 좋아 할 수 있습니다Android에서 응용 프로그램 간 통신
Intent i = new Intent(this, ActivityTwo.class);
i.putExtra("Value1", "This value is sent by FirstActivity ");
두 번째 활동에 대한 안드로이드 조치를 선언하고 조치 이름을 통해 첫 번째 활동에서 두 번째 작업을 호출합니다.
Intent i = new Intent("com.sample.action.MY_CUSTOM_ACTION");
i.putExtra("mystring","Sample Text");//optional.
startActivity(i);
신고해야합니까? 첫 번째 앱인 AndroidManifest.xml의 두 번째 활동은 무엇입니까? – user1955351
두 번째 응용 프로그램에 없음 – TNR
작동하지 않습니다. 프로세스가 예기치 않게 중지되었습니다. – user1955351
당신은 사용할 수 있습니다 : 그런 다음 아래와 같이 SecondActivity를 첫 번째 응용 프로그램을 설치하고 전화
<activity android:name=".SecondActivity">
<intent-filter>
<action android:name="com.sample.action.MY_CUSTOM_ACTION"/>
</intent-filter>
</activity>
등의 AndroidManifest.xml에서
선언 번째 활동 자세한 정보를 원하시면 아래의 예를 참조 Intent.setComponent
참조 http://stackoverflow.com/questions/8150003/how-to-export-an-activity-so-other-apps-can-call-it –