Tlaloc-ES
Tlaloc-ES

Reputation: 5282

Why am I getting a null from a parceleable

I am trying to get data from a parceleable of the next way:

First, create a Bundle of the following way:

final Bundle extras = new Bundle();

I set the data

extras.putParcelable(TelecomManager.EXTRA_INCOMING_CALL_EXTRAS, data);

And in the other activity I try to get the data of the next way:

  public Connection onCreateIncomingConnection(PhoneAccountHandle phoneAccountHandle, ConnectionRequest connectionRequest) {
        Log.e(TAG, "onCreateIncomingConnection");
        final Bundle bundle = connectionRequest.getExtras();

        final Data data = (Data) bundle.get(TelecomManager.EXTRA_INCOMING_CALL_EXTRAS);

But when I try to get the Data this is always null, but I check that this is not null when I set the data.

Any idea of why Data become to null?

Thanks

Upvotes: 0

Views: 73

Answers (1)

Zun
Zun

Reputation: 1681

replace .get with .getParcelable

Upvotes: 1

Related Questions