摘要:
1.在raw目录放一个mp3文件:test.mp3;2.建一个MediaPlay的Service文件MusicService.javapublic class MusicService extends Service{//MediaPlayer对象private MediaPlayerplayer;public IBinder onBind(Intent arg0){return null;}public void onStart(Intent intent, int startId){super.onStart(intent, startId);//这里可以理解为装载音乐文件player =
阅读全文
posted @ 2011-02-16 13:56
sunwei_07
阅读(679)
推荐(0)
编辑
摘要:
public void onCreate(Bundle savedInstanceState){TextView tv = new TextView(this);String string = "";super.onCreate(savedInstanceState);//得到ContentResolver对象 ContentResolver cr = getContentResolver(); //取得电话本中开始一项的光标 Cursor cursor = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, n
阅读全文
posted @ 2011-02-16 13:23
sunwei_07
阅读(677)
推荐(0)
编辑
摘要:
首先在layout里建2个xml文件分别有按钮1和按钮2JAVA代码:1.public class Activity01 extends Activity{public void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);/* 设置显示main.xml布局 */setContentView(R.layout.main);/* findViewById(R.id.button1)取得布局main.xml中的button1 */Button button = (Button) findViewByI
阅读全文
posted @ 2011-02-16 09:25
sunwei_07
阅读(768)
推荐(0)
编辑