Venky Venky - 10 months ago 80
Android Question

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?

Answer Source

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.