Skip to content

Instantly share code, notes, and snippets.

@happasuke
Created February 13, 2016 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save happasuke/13001483bec606e79f40 to your computer and use it in GitHub Desktop.
Save happasuke/13001483bec606e79f40 to your computer and use it in GitHub Desktop.
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;
public class AlarmReceiver extends BroadcastReceiver{
private final static String TAG = "AlarmReceiver";
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Alarm Received", Toast.LENGTH_SHORT).show();
Log.d(TAG, "Alarm Received:" + intent.getIntExtra(Intent.EXTRA_ALARM_COUNT, 0));
context.startService(new Intent(context, TTS.class));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment