摘要: Intent的常用Flag参数:FLAG_ACTIVITY_CLEAR_TOP:例如现在的栈情况为:A B C D 。D此时通过intent跳转到B,如果这个intent添加FLAG_ACTIVITY_CLEAR_TOP标记,则栈情况变为:A B。如果没有添加这个标记,则栈情况将会变成:A B C D B。也就是说,如果添加了FLAG_ACTIVITY_CLEAR_TOP标记,并且目标Activity在栈中已经存在,则将会把位于该目标activity之上的activity从栈中弹出销毁。这跟上面把B的Launch mode设置成singleTask类似。FLAG_ACTIVITY_NEW_TA 阅读全文
posted @ 2013-04-18 20:28 程序之魂 阅读(268) 评论(0) 推荐(0)
摘要: 在android SDK文档中有这样一个类,android.provider.Settings类提供android系统各个页面的跳转常量:使用实例例:startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS)),即可跳到android手机网络设置页面。如果要launch Mobile Networks Setting页面按如下方法:Intent intent=new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);ComponentName cName = new ComponentName 阅读全文
posted @ 2013-04-18 20:12 程序之魂 阅读(486) 评论(0) 推荐(0)
摘要: 有了 Service 类我们如何启动他呢,有两种方法: • Context.startService() • Context.bindService() 1. 在同一个应用任何地方调用 startService() 方法就能启动 Service 了,然后系统会回调 Service 类的 onCreate() 以及 onStart() 方法。这样启动的 Service 会一直运行在后台,直到 Context.stopService() 或者 selfStop() 方法被调用。另外如果一个 Service 已经被启动,其他代码再试图调用 startService() 方法,是不会执行 onCre. 阅读全文
posted @ 2013-04-18 19:10 程序之魂 阅读(336) 评论(0) 推荐(0)