use of android.content.IntentFilter in project PlayerHater by chrisrhoden.
the class BroadcastReceiver method register.
public static void register(Context context) {
BroadcastReceiver receiver = new BroadcastReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_HEADSET_PLUG);
filter.addAction(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
filter.addAction(Intent.ACTION_MEDIA_BUTTON);
filter.setPriority(10000);
context.registerReceiver(receiver, filter);
sInstance = receiver;
}
use of android.content.IntentFilter in project GeekNews by codeestX.
the class UpdateService method onStartCommand.
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
unregisterReceiver(receiver);
intent = new Intent(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/geeknews.apk")), "application/vnd.android.package-archive");
startActivity(intent);
stopSelf();
}
};
registerReceiver(receiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
startDownload();
return Service.START_STICKY;
}
use of android.content.IntentFilter in project cw-advandroid by commonsguy.
the class OrderedActivity method onResume.
@Override
public void onResume() {
super.onResume();
IntentFilter filter = new IntentFilter(NoticeService.BROADCAST);
filter.setPriority(2);
registerReceiver(onNotice, filter);
}
use of android.content.IntentFilter in project cw-omnibus by commonsguy.
the class EventLogFragment method onStart.
@Override
public void onStart() {
super.onStart();
IntentFilter filter = new IntentFilter(ACTION_EVENT);
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(onEvent, filter);
}
use of android.content.IntentFilter in project cw-omnibus by commonsguy.
the class BatteryFragment method onStart.
@Override
public void onStart() {
super.onStart();
IntentFilter f = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
getActivity().registerReceiver(onBattery, f);
}
Aggregations