android-mediaplayer

How to play YouTube in Background with Android Webview?

泪湿孤枕 提交于 2020-07-19 06:22:32
问题 I want to "minimize" the application, leaving it in background doing exactly the same that when the ghostbutton mode is pressed when the user clicks a button (but don't finish it) How can I do that? So far I'm able to create a Activity . I've initialize my members and load the WebView with "https://www.youtube.com". I'm also able to create a Service that lets me minimize the Activity , but what I want is to minimize the Activity that I've my WebView loaded. Problem When the Activity paused,

setAudioStreamType deprecated method, how i can replace it?

感情迁移 提交于 2020-07-18 21:43:31
问题 I am trying make a radio streaming app in android studio using mediaplayer, but i when compile shows the next error: uses or overrides a deprecated API. Recompile with -Xlint:deprecation for details. I was search in android documentation and i should reemplace this method for setAudioAttributes, i how can change it? i am new using android studio. Thanks. public class Radio extends Fragment { Button play_pause; MediaPlayer mp; @Override public View onCreateView(LayoutInflater inflater,