Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

People (bubbles): [FIXED] ClassCastException when trying to open VoiceCallActivity#188

Merged
yaraki merged 1 commit intoandroid:masterfrom
hossain-khan:bugfix/hk-people-bubble-video-call
Aug 11, 2020
Merged

People (bubbles): [FIXED] ClassCastException when trying to open VoiceCallActivity#188
yaraki merged 1 commit intoandroid:masterfrom
hossain-khan:bugfix/hk-people-bubble-video-call

Conversation

@hossain-khan
Copy link
Contributor

The activity was created with String icon ID, but was trying to extract Int causing following exception.

2020-08-10 20:41:11.681 17083-17083/com.example.android.people W/Bundle: Key icon expected Integer but value was a java.lang.String.  The default value 0 was returned.
2020-08-10 20:41:11.682 17083-17083/com.example.android.people W/Bundle: Attempt to cast generated internal exception:
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
        at android.os.BaseBundle.getInt(BaseBundle.java:1077)
        at android.content.Intent.getIntExtra(Intent.java:8183)
        at com.example.android.people.VoiceCallActivity.onCreate(VoiceCallActivity.kt:38)
        at android.app.Activity.performCreate(Activity.java:8000)

Fix was to pass the Uri that can be used by Glide to show the thumbnail icon.

Before Fix After Fix
device-2020-08-10-204207 device-2020-08-10-204639

The activity was created with String icon ID, but was trying to extract Int causing following exception.

```
2020-08-10 20:41:11.681 17083-17083/com.example.android.people W/Bundle: Key icon expected Integer but value was a java.lang.String.  The default value 0 was returned.
2020-08-10 20:41:11.682 17083-17083/com.example.android.people W/Bundle: Attempt to cast generated internal exception:
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
        at android.os.BaseBundle.getInt(BaseBundle.java:1077)
        at android.content.Intent.getIntExtra(Intent.java:8183)
        at com.example.android.people.VoiceCallActivity.onCreate(VoiceCallActivity.kt:38)
        at android.app.Activity.performCreate(Activity.java:8000)
```

Fix was to pass the Uri that can be used by Glide to show the thumbnail icon.
@hossain-khan
Copy link
Contributor Author

Hi @yaraki , I found this issue when working the the sample app. Thanks

@hossain-khan hossain-khan changed the title [FIXED] ClassCastException when trying to open VoiceCallActivity People (bubbles): [FIXED] ClassCastException when trying to open VoiceCallActivity Aug 11, 2020
Copy link
Contributor

@yaraki yaraki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this!

@yaraki yaraki merged commit 66133c2 into android:master Aug 11, 2020
@hossain-khan hossain-khan deleted the bugfix/hk-people-bubble-video-call branch August 11, 2020 01:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants