文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 计算机软件及应用 > 麦子学院Android开发教程开机自启动程序详解
侵权投诉

麦子学院Android开发教程开机自启动程序详解

Android开发教程开机自启动程序详解

32. 17

33. } catch (Exception e) {

34. 18

35. e.printStackTrace();

36. 19

37. } finally {

38. 20

39. finish(); // 关闭页面

40. 21

41. }

42. 22

43. }

44. 23

45. }.start();

46. 24

47. 48. 25

49. }

50. 26

51. }

52.

复制代码

这段代码很简单,当Activity 启动时,会显示TextView,用它显示你想显示的字样,并且这个页面只显示10秒后消失。

2、接收广播消息:BootBroadcastReceiver.java

1. 1

2. public class BootBroadcastReceiver extends BroadcastReceiver {

3. 02

4. static final String action_boot="android.intent.action.BOOT_COMPLETED";

5. 03

6.

7. 04

8. @Override

9. 05

10. public void onReceive(Context context, Intent intent) {

11. 06

12. if (intent.getAction().equals(action_boot)){

13. 07

上一页第2页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email