use of android.content.IntentFilter in project SimplifyReader by chentao0707.
the class NetStateReceiver method registerNetworkStateReceiver.
public static void registerNetworkStateReceiver(Context mContext) {
IntentFilter filter = new IntentFilter();
filter.addAction(CUSTOM_ANDROID_NET_CHANGE_ACTION);
filter.addAction(ANDROID_NET_CHANGE_ACTION);
mContext.getApplicationContext().registerReceiver(getReceiver(), filter);
}
use of android.content.IntentFilter in project SimplifyReader by chentao0707.
the class DownloadManager method setOnCreateDownloadListener.
private void setOnCreateDownloadListener(OnCreateDownloadListener listener) {
lis = listener;
if (listener == null) {
return;
}
OnCreateDownloadReceiver on = new OnCreateDownloadReceiver() {
@Override
public void onOneReady() {
if (lis != null)
lis.onOneReady();
}
@Override
public void onOneFailed() {
if (lis != null)
lis.onOneFailed();
}
@Override
public void onfinish(boolean isNeedRefresh) {
if (lis != null)
lis.onfinish(isNeedRefresh);
lis = null;
}
};
IntentFilter filter = new IntentFilter();
filter.addAction(ACTION_CREATE_DOWNLOAD_ONE_READY);
filter.addAction(ACTION_CREATE_DOWNLOAD_ONE_FAILED);
filter.addAction(ACTION_CREATE_DOWNLOAD_ALL_READY);
YoukuPlayerApplication.context.registerReceiver(on, filter);
}
use of android.content.IntentFilter in project SimplifyReader by chentao0707.
the class AcceleraterService method onCreate.
@Override
public void onCreate() {
Logger.d(TAG, "onCreate()");
mAccServiceManager = AcceleraterServiceManager.getInstance();
mInitLock = true;
IntentFilter i = new IntentFilter();
i.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
registerReceiver(mNetworkReceiver, i);
super.onCreate();
}
use of android.content.IntentFilter in project cw-android by commonsguy.
the class DownloadDemo method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mgr = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
registerReceiver(onComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
registerReceiver(onNotificationClick, new IntentFilter(DownloadManager.ACTION_NOTIFICATION_CLICKED));
}
use of android.content.IntentFilter in project cw-advandroid by commonsguy.
the class BatteryMonitor method onResume.
@Override
public void onResume() {
super.onResume();
registerReceiver(onBatteryChanged, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
}
Aggregations