2012-09-17 15:13:50 +00:00
|
|
|
package com.dougkeen.bart;
|
|
|
|
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
|
|
|
|
public class AlarmBroadcastReceiver extends BroadcastReceiver {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
|
WakeLocker.acquire(context);
|
|
|
|
|
2012-09-18 17:11:52 +00:00
|
|
|
BartRunnerApplication application = (BartRunnerApplication) context
|
|
|
|
.getApplicationContext();
|
|
|
|
application.setPlayAlarmRingtone(true);
|
|
|
|
|
|
|
|
Intent targetIntent = new Intent(Intent.ACTION_VIEW, application
|
|
|
|
.getBoardedDeparture().getStationPair().getUri());
|
2012-09-17 15:13:50 +00:00
|
|
|
targetIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
|
|
|
|
|
context.startActivity(targetIntent);
|
2012-09-19 21:12:18 +00:00
|
|
|
|
|
|
|
application.setAlarmPending(false);
|
2012-09-17 15:13:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|