在我的GcmIntentService中收到GCM Intent後,我正在構建推送通知,並且必須將特定的Activity設置爲EventListener。將事件監聽器添加到特定活動
public class GcmIntentService extends IntentService {
@Override
protected void onHandleIntent(final Intent intent) {
//This code gets triggered, what to add here
// to make SomeActivity's onEvent get triggered
}
}
public interface EventListener {
int onEvent(Event event);
}
public class SomeActivity extends Activity implements EventListener {
@Override
public int onEvent(Event event) {
}
}
在活動 – peter