摘要:
调用系统音乐播放器1 Intent internt = new Intent(Intent.ACTION_VIEW);2 internt.setDataAndType(Uri.parse(item.url), "audio/mp3");3 internt.setComponent(new ComponentName("com.android.music","com.android.music.MediaPlaybackActivity"));4 startActivity(internt);调用系统视频播放器1 Intent inte 阅读全文
摘要:
//主要使用子线程发送消息 使用Handler更新显示import java.text.SimpleDateFormat;import java.util.Date;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.app.Activity;import android.widget.TextView;public class MainActivity extends Activity implements Runnable{private Handler h. 阅读全文
摘要:
在Activity中,注册广播的一个Demo。总共分3步第一步:定义一个BroadcastReceiver广播接收类:view plainprivate BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver(){ @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if(action.equals(ACTION_NAME)){ Toast.makeText(Test.this, 阅读全文