I trying to test an Chrome-cast Android Sample media app. Everything is working fine, except it disconnects as soon as I get out of the app. How to show status of the video playing on the Notification bar or Lock Screen and keep connection between phone and device even when we get out of the app.
Pressing Home when in the app should keep the video playing.
If you want to use the Back button and keep the video playing you have to override the activity onBackPressed:
@Override
public void onBackPressed() {
moveTaskToBack(true);
}