摘要: 一、SlidingMenu配置方法 1.下载SlidingMenu:https://github.com/jfeinstein10/SlidingMenu 2.拷贝SlidingMenu-master中的library文件到自己所创建项目中与app同级的位置,并修改其名称为SlidingMenu 3 阅读全文
posted @ 2016-02-25 11:16 ql698214 阅读(397) 评论(0) 推荐(0) 编辑
摘要: 一、使用Fragment 1.AndroidManifest.xml文件 <?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" packag 阅读全文
posted @ 2016-01-30 19:52 ql698214 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 一、WebView请求权限实例 1.WebView获取网页访问权限的xml布局文件和MainActivity中的程序如下 webView= (WebView) findViewById(R.id.wv);webView.loadUrl(http://www.jikexueyuan.com); 2.若想获得访问权限还需要在AndroidManifest.xml文件中定义uses-permi... 阅读全文
posted @ 2016-01-24 14:17 ql698214 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Android SDK 在线更新镜像服务器资源:大连东软信息学院镜像服务器地址:http://mirrors.neusoft.edu.cn 端口:80北京化工大学镜像服务器地址:IPv4: http://ubuntu.buct.edu.cn/ 端口:80IPv4: http://ubuntu.buc... 阅读全文
posted @ 2016-01-23 18:28 ql698214 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 一、使用Broadcast Reciver1.右击java文件夹,new->other->Broadcast Receiver后会在AndroidManifest.xml文件中生成一个receiver项 ... 阅读全文
posted @ 2016-01-23 16:24 ql698214 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 一、跨应用启动ServiceIntent serviceIntent=new Intent();serviceIntent.setComponent(new ComponentName("com.example.shiyanshi.startservicefromanotherapp","com.e... 阅读全文
posted @ 2016-01-10 16:50 ql698214 阅读(478) 评论(0) 推荐(0) 编辑
摘要: 一、启动Service并传递参数传递参数时只需在startService启动的Intent中传入数据便可,接收参数时可在onStartCommand函数中通过读取第一个参数Intent的内容来实现1.MainActivity.javapackage com.example.shiyanshi.ser... 阅读全文
posted @ 2016-01-08 22:46 ql698214 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 一、使用Service1.右击java文件夹,选择新建Service,然后重写其中的onStartCommand函数,只要执行了startService函数,onStartCommand便会被执行package com.example.shiyanshi.learnservice;import an... 阅读全文
posted @ 2016-01-07 19:25 ql698214 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 代码中的中文注释可能会引起Gradle报错解决办法: 在项目下的build.gradle下添加以下代码即可解决[java] view plaincopyprint?tasks.withType(Compile) { options.encoding = "UTF-8"} Gradle2.0+环境... 阅读全文
posted @ 2016-01-05 10:36 ql698214 阅读(3106) 评论(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 阅读(286) 评论(0) 推荐(0) 编辑