随笔分类 -  01安卓开发知识体系-Android基础知识

摘要:一、使用Broadcast Reciver1.右击java文件夹,new->other->Broadcast Receiver后会在AndroidManifest.xml文件中生成一个receiver项 ... 阅读全文
posted @ 2016-01-23 16:24 ql698214 阅读(431) 评论(0) 推荐(0)
摘要:一、跨应用启动ServiceIntent serviceIntent=new Intent();serviceIntent.setComponent(new ComponentName("com.example.shiyanshi.startservicefromanotherapp","com.e... 阅读全文
posted @ 2016-01-10 16:50 ql698214 阅读(491) 评论(0) 推荐(0)
摘要:一、启动Service并传递参数传递参数时只需在startService启动的Intent中传入数据便可,接收参数时可在onStartCommand函数中通过读取第一个参数Intent的内容来实现1.MainActivity.javapackage com.example.shiyanshi.ser... 阅读全文
posted @ 2016-01-08 22:46 ql698214 阅读(331) 评论(0) 推荐(0)
摘要:一、使用Service1.右击java文件夹,选择新建Service,然后重写其中的onStartCommand函数,只要执行了startService函数,onStartCommand便会被执行package com.example.shiyanshi.learnservice;import an... 阅读全文
posted @ 2016-01-07 19:25 ql698214 阅读(273) 评论(0) 推荐(0)
摘要:一、Context的作用Context可用于访问全局资源.public class MainActivity extends Activity { private TextView tv; @Override protected void onCreate(Bundle sa... 阅读全文
posted @ 2016-01-04 10:42 ql698214 阅读(301) 评论(0) 推荐(0)
摘要:一、显示Intent startActivity(new Intent(MainActivity.this,BAty.class)); 显示Intent直接指定要启动的Intent类 注意自己通过创建一个java类,然后让其继承Activity时,只需在该类中添加onCreate重载函数,然后... 阅读全文
posted @ 2015-12-28 11:30 ql698214 阅读(243) 评论(0) 推荐(0)
摘要:一、标准模式(standrard)1.当新建一个Activity时,默认情况下就是标准模式,也可以通过AndroidManifest文件显示指定其launchMode为standard ... 阅读全文
posted @ 2015-12-28 10:02 ql698214 阅读(199) 评论(0) 推荐(0)
摘要:1.主Activity,用于启动另一个Activity()public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { ... 阅读全文
posted @ 2015-12-23 21:27 ql698214 阅读(458) 评论(0) 推荐(0)