📄 playservice.java
字号:
package com.iceskysl.PlayService;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class PlayService extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button1 = (Button)findViewById(R.id.start); button1.setOnClickListener(startIt); Button button2 = (Button)findViewById(R.id.stop); button2.setOnClickListener(stopIt); } private OnClickListener startIt = new OnClickListener() { public void onClick(View v) { startService(new Intent("com.iceskysl.PlayService.START_AUDIO_SERVICE")); } }; private OnClickListener stopIt = new OnClickListener() { public void onClick(View v) { stopService(new Intent("com.iceskysl.PlayService.START_AUDIO_SERVICE")); finish(); } };}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -