登录
首页 » Android » Android 简单播放歌曲功能演示

Android 简单播放歌曲功能演示

于 2023-08-23 发布 文件大小:1.21 MB
0 100
下载积分: 2 下载次数: 1

代码说明:

Android 简单播放歌曲功能演示,播放本地音乐,非网络播放,可播放、暂停,运行效果如截图所示,在编写时,要注意以下代码:   int status = 1;//当前的状态,1没有声音播放 ,2 正在播放声音,3暂停   ImageButton start;//播放、暂停按钮   ImageButton stop;//停止按钮   ActivityReceiver activityReceiver;   int status = 1;//当前的状态,1没有声音播放 ,2 正在播放声音,3暂停   public void onCreate(Bundle savedInstanceState) {//重写的onCreate方法    super.onCreate(savedInstanceState);    setContentView(R.layout.main);//设置当前的用户界面    start = (ImageButton) this.findViewById(R.id.start);//得到start的引用    stop = (ImageButton) this.findViewById(R.id.stop);//得到stop按钮的引用    start.setOnClickListener(this);//为按钮添加监听    stop.setOnClickListener(this);//为按钮添加监听    activityReceiver = new ActivityReceiver();//创建BroadcastReceiver    IntentFilter filter = new IntentFilter();//创建IntentFilter过滤器    filter.addAction("wyf.ytl.update");//添加Action    registerReceiver(activityReceiver, filter);//注册监听    Intent intent = new Intent(this, MyService.class);//创建Intent    startService(intent);//启动后台Service   }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 文件操作
    android中的文件操作,包括列表显示,进入,退出,删除,复制粘贴,新建文件等等 
    2022-11-20 19:35:04下载
    积分:1
  • Android实现Banner轮播效果
    Android实现Banner轮播效果.zip                                                                         可以实现广告轮播效果
    2022-01-26 07:53:05下载
    积分:1
  • 3D打印机固件Repetier-Firmware
    应用背景#define NUM_EXTRUDER 1 #define MOTHERBOARD 33 #include "pins.h" // ################## EDIT THESE SETTINGS MANUALLY ################ // ################ END MANUAL SETTINGS ########################## #define FAN_BOARD_PIN -1 //#define EXTERNALSERIAL  use Arduino serial library instead of build in. Requires more ram, has only 63 byte input buffer. // Uncomment the following line if you are using arduino compatible firmware made for Arduino version earlier then 1.0 // If it is incompatible you will get compiler errors about write functions not beeing compatible! //#define COMPAT_PRE1 #define BLUETOOTH_SERIAL  -1 #define BLUETOOTH_BAUD  115200 #define MIXING_EXTRUDER 0 #define DRIVE_SYSTEM 0 #define XAXIS_STEPS_PER_MM 80 #define YAXIS_STEPS_PER_MM 80 #define ZAXIS_STEPS_PER_MM
    2022-06-20 21:55:21下载
    积分:1
  • Induction-Motor-Analysis-GUI
    it is a great working machine for us
    2018-02-05 22:44:54下载
    积分:1
  • android 倒计时闹钟例子源码
    用timetasker每秒执行一次并且按照时间显示常规减去分或秒
    2014-10-17下载
    积分:1
  • android 项目 五子棋游戏 项目源码
    android 项目 五子棋游戏 项目源码
    2013-10-28下载
    积分:1
  • android使用socket原生开发聊天系统
    android 使用socket 开发的聊天系统,原生代码建立数据库,存储聊天数据等
    2023-01-08 07:35:23下载
    积分:1
  • btsppdemo
    android 系统下蓝牙spp的demo软件。(this is a demo code for bluetooth spp profile on android os.)
    2014-09-27 10:20:52下载
    积分:1
  • android 监听自身被卸载 例子源码
    android 监听自身被卸载 例子源码
    2014-09-23下载
    积分:1
  • android平台的linphone客户端
    已经编译好的android平台的linphone客户端,包含了所有运行需要到得动态库文件。
    2022-12-12 17:50:03下载
    积分:1
  • 696518资源总数
  • 105877会员总数
  • 14今日下载