NotificationManager nm = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
String action = intent.getAction();
if (Config.LOGD) Log.d(TAG, "onReceiveIntent " + action);
if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
nm.cancel(SDCARD_STATUS);
Intent statusIntent = new Intent(Intent.ACTION_MAIN, null);
statusIntent.setClass(context, SdCardSettings.class);
nm.notify(SDCARD_STATUS, new Notification(context,
android.R.drawable.stat_notify_sdcard,
null,
System.currentTimeMillis(),
context.getText(R.string.sdcard_setting),
null,
statusIntent));
} else if (action.equals(Intent.ACTION_MEDIA_REMOVED)) {
nm.cancel(SDCARD_STATUS);
} else if (action.equals(Intent.ACTION_MEDIA_SHARED)) {
nm.cancel(SDCARD_STATUS);
Intent statusIntent = new Intent(Intent.ACTION_MAIN, null);
statusIntent.setClass(context, SdCardSettings.class);
nm.notify(SDCARD_STATUS, new Notification(context,
android.R.drawable.stat_notify_sdcard_usb,
null,
System.currentTimeMillis(),
"SD Card",
null,
statusIntent));
}