Code example for UsbAccessory

Methods: equals

0
		public void onReceive(Context context, Intent intent) {
			String action = intent.getAction();
			if (UsbManager.ACTION_USB_ACCESSORY_DETACHED.equals(action)) {
				UsbAccessory accessory = (UsbAccessory)
		                   intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
				if (accessory != null && accessory.equals(mAccessory)) {
					Log.i(TAG, "closing accessory");
				} 
			} 
		} 
	}; 
	 
	protected class ListenerTask extends AsyncTask<InputStream, String, Void> {
		@Override 
		protected Void doInBackground(InputStream... params) {
			byte[] buffer = new byte[1024];
			InputStream lis = params[0];
			int r_idx;
			int res = 0;
			int idx = 0;
Contextual code suggestions in your IDE  Get Codota for Java