Is there a way to detect when a user minimizes the fire tv application by pressing the home icon on the remote?
Asked
Active
Viewed 102 times
1 Answers
2
No there is no key event to detect the Home button key press but u can check for onStop method of the activity and where u can add additional condition whether backkey pressed or not as its always called before onStop().
boolean flag=false;
@Override
public void onBackPressed() {
super.onBackPressed();
flag=true;
}
@Override
protected void onStop() {
super.onStop();
if(flag){
//back button pressed
}
else{
// Home button pressed
}
}

user3732629
- 141
- 15
-
I was curious as to how we should exit a Fire TV app after using it. With the home button pressed, it appears to do nothing except minimizing the app from the screen where we left off. How can apps with login sessions get around this? For example, suppose a user is watching videos and then minimizes the app by clicking the home button. When the user re-opens the app after a while, they will see the screen where they left off previously. The API will not work if the session has already ended. – Joseph Martínez Jan 08 '22 at 01:10