Android: Status Bar Notifications
Is there any way to catch/detect the start or instance of the system notifications on the status bar? I am planning to redirect the notif开发者_如何学JAVAications appearing on the status bar into a simple toast or the likes.
AFAIK, there isn't any way of doing that.
EDIT : Adding example to handle the sdcard events
IntentFilter f = new IntentFilter();
f.addAction(Intent.ACTION_MEDIA_EJECT);
f.addAction(Intent.ACTION_MEDIA_MOUNTED);
f.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
f.addAction(Intent.ACTION_MEDIA_BAD_REMOVAL);
f.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
f.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
f.addDataScheme("file");
registerReceiver(mScanListener, f);
private BroadcastReceiver mScanListener = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
...
}
}
精彩评论