Advertisement
Guest User

Untitled

a guest
Oct 26th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. package com.test.brzoracunanje;
  2.  
  3. import android.app.Service;
  4. import android.content.Intent;
  5. import android.media.MediaPlayer;
  6. import android.os.IBinder;
  7.  
  8. public class BackgroundSoundService extends Service {
  9. private static final String TAG = null;
  10. MediaPlayer player;
  11. public IBinder onBind(Intent arg0) {
  12.  
  13. return null;
  14. }
  15. @Override
  16. public void onCreate() {
  17. // TODO Auto-generated method stub
  18. super.onCreate();
  19. player = MediaPlayer.create(this, R.raw.test_cbr);
  20. player.setLooping(true); // Set looping
  21. player.setVolume(100,100);
  22. player.start();
  23. }
  24. @Override
  25. public void onStart(Intent intent, int startId) {
  26. // TODO Auto-generated method stub
  27. super.onStart(intent, startId);
  28. }
  29. public void onDestroy() {
  30. // TODO Auto-generated method stub
  31. super.onDestroy();
  32. }
  33.  
  34.  
  35.  
  36. }
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement