Skip to content
Snippets Groups Projects

Fix app crashing when opening video from outside and changing the orientation

Merged Nicolas Pomepuy requested to merge Aza/vlc-android:fix_crash into master

The issue was introduced in !1738 (merged)

The intent of this MR was to implement the following behavior:

sequenceDiagram
    participant A as ExternalApp
    box Purple VLC
    participant S as StartActivity
    participant V as VideoPlayerActivity
    end
    A->>+S: startActivityForResult
    Note over S: prevent closing
    S->>+V: startActivityForResult
    Note over V: playing then user closes
    V->>+S: setResult
    S->>+A: setResult

Now if the user changes the orientation during the playback

sequenceDiagram
    participant A as ExternalApp
    box Purple VLC
    participant S as StartActivity
    participant V as VideoPlayerActivity
    end
    A->>+S: startActivityForResult
    Note over S: prevent closing
    S->>+V: startActivityForResult
    Note over V: playing and the user<br>changes the orientation
    Note over S: DESTROYED
    Note over V: Not destroyed because<br>of configChanges
    Note over V: playing then user closes
    V->>+S: 
    loop 
    Note over S: onCreate again
    S->>+V: startActivityForResult again
    end

That's why the proposed solution is to give the StartActivity the exact same configChanges as the VideoPlayerActivity so it's not destroyed when the configuration is changed during the playback

Edited by Nicolas Pomepuy

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading