I have a Tab with a WebView inside displaying a list of Videos from a homepage. Once I click on a Video I setContentView(video) which is a XML holding only a VideoView. I added an onCompletionListener to the VideoView, so when the video is over, i would like to setContentView(webview). My LogCat shows me that the WebView is loading but i never shows up. screen stays black. How do i get the focus back to the WebView?
Share
Instead of using two different layouts and calling setContentView() when you want to switch I think you should put your WebView and VideoView into the same layout, and use
View.setVisibility(View.INVISIBLE);andView.setVisibility(View.VISIBLE);to control which one is being shown at the appropriate times.