All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mle.android.messaging.GcmReceiver.scala Maven / Gradle / Ivy

The newest version!
package com.mle.android.messaging

import android.content.{ComponentName, Intent, Context}
import android.support.v4.content.WakefulBroadcastReceiver
import android.app.Activity

/**
 *
 * @author mle
 */
abstract class GcmReceiver(serviceClass: Class[_]) extends WakefulBroadcastReceiver {
  override def onReceive(context: Context, intent: Intent): Unit = {
    val comp = new ComponentName(context.getPackageName, serviceClass.getName)
    WakefulBroadcastReceiver.startWakefulService(context, intent setComponent comp)
    setResultCode(Activity.RESULT_OK)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy