Intent getByteArrayExtra - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Intent getByteArrayExtra method.

This code example shows how to use the following methods:getByteArrayExtra
        Log.d(LOG_TAG, "DrmReceiver received.");
 
        byte[] body;
        byte[] header;
 
        body = intent.getByteArrayExtra("data");
        header = intent.getByteArrayExtra("header");
 
        Log.d(LOG_TAG, "header:");
        Log.d(LOG_TAG, HexDump.dumpHexString(header));
        Log.d(LOG_TAG, "body:");
        Log.d(LOG_TAG, HexDump.dumpHexString(body));
 
        DataVerify.SetLastReceivedPdu(body);
    } 
 
} 
 
 
7
CodeRank
This code example shows how to use the following methods:getByteArrayExtra
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.d(LOG_TAG, "Receiver service started");
 
        byte[] body;
        byte[] header;
        body = intent.getByteArrayExtra("data");
        header = intent.getByteArrayExtra("header");
 
        Log.d(LOG_TAG, "header:");
        Log.d(LOG_TAG, HexDump.dumpHexString(header));
        Log.d(LOG_TAG, "body:");
        Log.d(LOG_TAG, HexDump.dumpHexString(body));
 
        DataVerify.SetLastReceivedPdu(body);
        return START_STICKY;
    } 
} 
 
 
7
CodeRank
This code example shows how to use the following methods:getByteArrayExtra, getIntExtra, getStringExtra
   *  the fields will be null. 
   */ 
  public static IntentResult parseActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == REQUEST_CODE) {
      if (resultCode == Activity.RESULT_OK) {
        String contents = intent.getStringExtra("SCAN_RESULT");
        String formatName = intent.getStringExtra("SCAN_RESULT_FORMAT");
        byte[] rawBytes = intent.getByteArrayExtra("SCAN_RESULT_BYTES");
        int intentOrientation = intent.getIntExtra("SCAN_RESULT_ORIENTATION", Integer.MIN_VALUE);
        Integer orientation = intentOrientation == Integer.MIN_VALUE ? null : intentOrientation;
        String errorCorrectionLevel = intent.getStringExtra("SCAN_RESULT_ERROR_CORRECTION_LEVEL");
        return new IntentResult(contents,
                                formatName,
                                rawBytes,
                                orientation,
                                errorCorrectionLevel);
      } 
      return new IntentResult(); 
    } 
    return null; 
8
CodeRank

Related Intent getByteArrayExtra Questions & Answers:

getByteArrayExtra Method Overview
Retrieve extended data from the intent.
See Code Examples for other Android Intent Methods: