package com.xhly.manageapp.broadcastreceiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent

class SDReceiver: BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        val action = intent.action
        when (action) {
            Intent.ACTION_MEDIA_CHECKING->
            {
                //SD卡正在检查
            }
             Intent.ACTION_MEDIA_MOUNTED->
             {
                 //SD卡挂载成功
             }
            Intent.ACTION_MEDIA_EJECT->{
                //SD卡拔出

            }
            Intent.ACTION_MEDIA_UNMOUNTED->{
                //SD卡卸载成功
            }
        }
    }
}