Search in sources :

Example 11 with IntentFilter

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);
}
Also used : IntentFilter(android.content.IntentFilter)

Example 12 with IntentFilter

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);
}
Also used : IntentFilter(android.content.IntentFilter)

Example 13 with IntentFilter

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();
}
Also used : IntentFilter(android.content.IntentFilter)

Example 14 with IntentFilter

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));
}
Also used : IntentFilter(android.content.IntentFilter)

Example 15 with IntentFilter

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));
}
Also used : IntentFilter(android.content.IntentFilter)

Aggregations

IntentFilter (android.content.IntentFilter)1441 Intent (android.content.Intent)493 Context (android.content.Context)292 BroadcastReceiver (android.content.BroadcastReceiver)274 PendingIntent (android.app.PendingIntent)148 RemoteException (android.os.RemoteException)80 ComponentName (android.content.ComponentName)54 Handler (android.os.Handler)53 View (android.view.View)45 Test (org.junit.Test)41 Uri (android.net.Uri)40 PowerManager (android.os.PowerManager)38 ArrayList (java.util.ArrayList)37 TextView (android.widget.TextView)36 ResolveInfo (android.content.pm.ResolveInfo)30 File (java.io.File)29 Point (android.graphics.Point)28 PackageManager (android.content.pm.PackageManager)27 IOException (java.io.IOException)25 HandlerThread (android.os.HandlerThread)24