In my app, on a particular button click, the youtube application starts and some video gets played. This is the code for the same.
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:0ee3R3tfdd4"));
startActivity(i);
Is it possible to close the youtube app when the video is finished and return back gracefully to my app (without the user pressing the back button) ?
No, it’s not possible.
Using this code you are open a third party youtube application, So you don’t have any type of control over it.
You have to press Back Button to coming back to your application. Or integrate Your own
VideoViewin your application for display youtube video.