0% found this document useful (0 votes)
58 views3 pages

Walaupun Android Service

Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan

Uploaded by

Nael Rahmasari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views3 pages

Walaupun Android Service

Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan Vol2icd 2014 Translation Vol2icd 2014 Translation xsa ajak alak maan

Uploaded by

Nael Rahmasari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

package

com.jorgesys.musicbackground;
import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Button btnPlay =
(Button)findViewById(R.id.btnPlay);
final TextView textView =
(TextView)findViewById(R.id.textView);
btnPlay.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v) {
if(btnPlay.getText().equals("Start")) {
Intent myService = new
Intent(MainActivity.this, BackgroundSoundService.class);
startService(myService);
btnPlay.setText("Stop");

textView.setTextColor(Color.parseColor("#FF0000"));
}else {
Intent myService = new
Intent(MainActivity.this, BackgroundSoundService.class);
stopService(myService);
btnPlay.setText("Start");

textView.setTextColor(Color.parseColor("#0000FF"));
}
}
});
}
}
package
com.jorgesys.musicbackground;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;
/**
* Created by jorgesys on 02/02/2015.
*/
/* Add declaration of this service into the
AndroidManifest.xml inside application tag*/
public class BackgroundSoundService extends Service {
private static final String TAG =
"BackgroundSoundService";
MediaPlayer player;
public IBinder onBind(Intent arg0) {
Log.i(TAG, "onBind()" );
return null;
}
@Override
public void onCreate() {
super.onCreate();
player = MediaPlayer.create(this,
R.raw.jorgesys_song);
player.setLooping(true); // Set looping
player.setVolume(100,100);
Toast.makeText(this, "Service started...",
Toast.LENGTH_SHORT).show();
Log.i(TAG, "onCreate() , service started...");
}
public int onStartCommand(Intent intent, int flags, int
startId) {
player.start();
return Service.START_STICKY;
}
public IBinder onUnBind(Intent arg0) {
Log.i(TAG, "onUnBind()");
return null;
}
public void onStop() {
Log.i(TAG, "onStop()");
}
public void onPause() {
Log.i(TAG, "onPause()");
}
@Override
public void onDestroy() {
player.stop();
player.release();
Toast.makeText(this, "Service stopped...",
Toast.LENGTH_SHORT).show();
Log.i(TAG, "onCreate() , service stopped...");
}
@Override
public void onLowMemory() {
Log.i(TAG, "onLowMemory()");
}
}

You might also like