Hi,
I am attempting to get the following service to work, and running into
problems. Seemingly the onStart function has updated parameters. It is
now expecting the Intent and an integer. How do I get the intent to
pass in to the function?
thanks
package com.stevemacleod.prankapp;
import java.io.IOException;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Binder;
import android.media.MediaPlayer;
public class PrankService extends Service
{
MediaPlayer player = null;
String str;
public IBinder onBind(Intent intent)
{
return null;
}
public void onStart(int startId, Bundle arguments)
{
super.onStart(startId, arguments);
try
{
player = MediaPlayer.create((Context)this,
R.raw.groove_arm);
player.start();
} catch (IOException e)
{
System.out.print("Exception while starting audio");
}
}
public void onDestroy()
{
super.onDestroy();
player.stop();
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---