One Public Media Player Class To Be Used Across All Activities
Updated. After the recommendations, I decided to run media player in a new thread. Because I need Media Player only when activities are on the screen. Here is the new code: First,
Solution 1:
Your media player instance is going to live on the main thread, which is the UI thread. This is not recommended.
I would probably create a service that would create a new thread holding the media player. Each of your activities could then bind to the service to control the media player.
See section Extending the service class.
You can also look at the media player sample.
Post a Comment for "One Public Media Player Class To Be Used Across All Activities"