Search code examples
androidparsingparcelable

Get Value from Parcelable Array in Android


I need to parse and get the Value from :

Parcelable[] uuidExtra = intent.getParcelableArrayExtra("android.bluetooth.device.extra.UUID");

My goal is to get UUID from above Parcelable[]. How to achieve it?


Solution

  • From the docs it states that the extra is a ParcelUuid

    So you should use

    ParcelUuid uuidExtra intent.getParcelableExtra("android.bluetooth.device.extra.UUID");
    UUID uuid = uuidExtra.getUuid();
    

    Hope that helps.