.
<receiver android:name=".ReceiverDemo">
<intent-filter>
<action android:name="marakana.intent.action.ReceiverDemo" />
</intent-filter>
</receiver>
프로그램 등록.
...
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
// Create the receiver
receiver = new TimelineReceiver();
filter = new IntentFilter(UpdaterService.NEW_STATUS_INTENT);
}
protected void onResume() {
super.onResume();
super.registerReceiver(receiver, filter,
"com.marakana.yamba.SEND_TIMELINE_NOTIFICATIONS", null);
}
@Override
protected void onPause() {
super.onPause();
unregisterReceiver(receiver);
}
...
UPDATE : 여러 값 하나 개 이상의 값이 지정 될 수 있다면, 요소가 거의 항상 오히려 하나의 요소 내에서 여러 값을 나열하는 것보다, 반복한다.
<intent-filter . . . >
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.INSERT" />
<action android:name="android.intent.action.DELETE" />
. . .
</intent-filter>
UPDATE2 : 매니페스트에 인 텐트 필터의 android:name
그냥 임의의 AndroidManifest.xml
<manifest
package="com.marakana.android.lifecycle"
android:versionCode="1"
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="11" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<application
android:name=".ApplicationDemo"
android:icon="@drawable/icon"
android:label="@string/app_name">
<activity
android:name=".ActivityDemo"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AnotherActivity"></activity>
<activity android:name=".SystemServicesDemo"></activity>
<service android:name=".ServiceDemo"></service>
<service android:name=".IntentServiceDemo">
<intent-filter>
<action android:name="marakana.intent.action.IntentServiceDemo" />
</intent-filter>
</service>
<receiver android:name=".ReceiverDemo">
<intent-filter>
<action android:name="marakana.intent.action.ReceiverDemo" />
</intent-filter>
</receiver>
<provider
android:name=".ProviderDemo"
android:authorities="com.marakana.android.lifecycle.providerdemo" />
</application>
</manifest>
나는 아직도 그것을 얻지 못한다, marakana.intent.action.ReceiverDemo는 무엇을 나타내는가? – Jolin
위 내 대답을 업데이트했습니다. – NMALKO
예.하지만 제 경우에는이 의도를 어떻게 받아야합니까? Intent in = New Intent (PlAY_FINISHED); 이것은 내가 알고 싶은 모든 것입니다 ... – Jolin