Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 1    Views: 245

miku
Aspiring developer
Profile
Posts: 405
Reg: Feb 20, 2014
zagorje ob savi
10,600
05/20/14 03:36 AM (9 years ago)

Make Android back button to stop audio in CustomHTML screen

Hello, I would like to stop music in my HTML5 player when back button is pressed. I found this from ian@buzztouch: //onDestroy @Override public void onDestroy() { super.onDestroy(); webView.loadUrl("about:blank"); //BT_debugger.showIt(activityName + ":onDestroy"); } This is for Html Screen, I have CustomHTML and in my BT_screen_customHTML.java I can't find //onDestroy. Where should I place this script?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/20/14 05:55 PM (9 years ago)
If you can't 'find' onDestroy, go ahead and create it. Just paste that entire snippet 'outside' of any other java method in your class. Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.