android - Accessing Media Player instance for playing Background Music -


I am developing an application that will play Ajan at specific times, for this, I have created an Assigned Task Class and whenever The time the system matches, the player starts playing. But this gives me a null pointer exception because it fails to reach the media player in Ajna. So what is the process of reaching the media player frequency in asynchTask class, so that I can play in the background, though the user is on another app screen, the player should start playing.

This is my code

  class in azanBackground asynchTask and lt; VOID, VOID, VOID & gt; {protected void doInBackground & lt; Zero ... Parameters & gt; {String temp = "2:50 am" if (systemTime.equals (temp)) {azan.fplayer.start (); // I'm getting a null pointer exception}    

In order for media your The app is played in the background of the location when the user is interacting with it. You must start the service / broadcast-receiver with the main activity of your application and include all the methods related to playback in the service / broadcast-receiver. To allow activity to interact with the service, a service connection is also required. In essence, we need to implement a bound service.

Start the service with a pending intimation such as alarm-service

view

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -