Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

addons: autoplay no longer overrides an explicitly requested page

venuprasath9ae85ee5cd35
diff --git a/addons/tv-hub/app/src/main/java/io/github/maxhayim/tvhub/ui/MainActivity.kt b/addons/tv-hub/app/src/main/java/io/github/maxhayim/tvhub/ui/MainActivity.kt
index df640674e..9bf95f090 100644
--- a/addons/tv-hub/app/src/main/java/io/github/maxhayim/tvhub/ui/MainActivity.kt
+++ b/addons/tv-hub/app/src/main/java/io/github/maxhayim/tvhub/ui/MainActivity.kt
@@ -93,7 +93,10 @@ class MainActivity : Activity() {
repo.refreshIfStale()
// savedInstanceState == null: a fresh launch, not Android rebuilding the window, so
// coming back from the player with Back leaves you on the hub instead of looping.
- if (savedInstanceState == null && repo.prefs.autoPlay) autoPlayWhenReady()
+ // An explicit page (EXTRA_PAGE) means the caller asked for that screen, so opening the
+ // player over it would throw the request away.
+ val askedForPage = intent.hasExtra(EXTRA_PAGE)
+ if (savedInstanceState == null && !askedForPage && repo.prefs.autoPlay) autoPlayWhenReady()
}
}