Android Open Source - LocalStorage Media Availability Broadcast Receiver






From Project

Back to project page LocalStorage.

License

The source code is released under:

BSD 3-Clause License Copyright (c) 2013, Ian Lake All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following cond...

If you think the Android project LocalStorage listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ianhanniballake.localstorage;
//  w w  w .j  a v  a 2s .co  m
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.provider.DocumentsContract;

/**
 * Receives MEDIA_MOUNTED and MEDIA_REMOVED actions in response to external storage devices changing state
 */
public class MediaAvailabilityBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(final Context context, final Intent intent) {
        // Update the root URI to ensure that only available storage directories appear
        context.getContentResolver().notifyChange(
                DocumentsContract.buildRootsUri(LocalStorageProvider.AUTHORITY), null);
    }
}




Java Source Code List

com.ianhanniballake.localstorage.DonateActivity.java
com.ianhanniballake.localstorage.LocalStorageProvider.java
com.ianhanniballake.localstorage.MainActivity.java
com.ianhanniballake.localstorage.MediaAvailabilityBroadcastReceiver.java
com.ianhanniballake.localstorage.inappbilling.Base64DecoderException.java
com.ianhanniballake.localstorage.inappbilling.Base64.java
com.ianhanniballake.localstorage.inappbilling.Inventory.java
com.ianhanniballake.localstorage.inappbilling.Purchase.java
com.ianhanniballake.localstorage.inappbilling.Security.java
com.ianhanniballake.localstorage.inappbilling.SkuDetails.java