package com.oo.eye;

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

import com.app.baselibrary.commonUtil.ToastUtil;

/**
 * Created by xucon on 2018/9/11.
 */

public class UsbReceiver extends BroadcastReceiver {
	@Override
	public void onReceive(Context context, Intent intent) {
		String action = intent.getAction();
		if (action.equals(Intent.ACTION_MEDIA_EJECT)) {
			ToastUtil.showLongMessage("移除");
			//USB设备移除，更新UI
		} else if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
			ToastUtil.showLongMessage("插入");
			//USB设备挂载，更新UI
		}
	}
}
