2017年9月25日

build.gradle

摘要: 1、将Eclipse项目导入到Android studio 中 很多点9图出现问题解决方法: 在build.gradle里添加以下两句: aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false 用来关闭Androi 阅读全文
posted @ 2017-09-25 15:20 随缘101 阅读(239) 评论(0) 推荐(0) 编辑
2016年12月29日

CardView

摘要: CardView继承至FrameLayout类,可以在一个卡片布局中一致性的显示内容,卡片可以包含圆角和阴影。CardView是一个Layout,可以布局其他View。 CardView常用属性: card_view:cardElevation 阴影的大小及柔和度,以至于可以逼真的模拟出对于深度效果 阅读全文
posted @ 2016-12-29 09:41 随缘101 阅读(733) 评论(0) 推荐(0) 编辑
2016年12月20日

project.VERSION_NAME定义

摘要: 上面两句分别配置了项目的Sdk版本和编译Tools版本,在下面的defaultConfig 中配置了 minSdkVersion 、targetSdkVersion 、versionCode 和versionName,相信大家这些都看得懂这些名词的意思, 然后看他们对应的值,project.VERS 阅读全文
posted @ 2016-12-20 00:41 随缘101 阅读(2534) 评论(0) 推荐(0) 编辑
2016年12月6日

HttpURLConnection使用getInputStream无法执行

摘要: url = new URL(urlStr); urlConn = (HttpURLConnection) url.openConnection(); // 设置请求方式为"GET" urlConn.setRequestMethod("GET"); // 超时响应时间为5秒 urlConn.setCo 阅读全文
posted @ 2016-12-06 10:19 随缘101 阅读(9291) 评论(0) 推荐(0) 编辑
2016年12月2日

文件是否存在

摘要: /** * 判断SD卡上的文件是否存在 * * pathName = "/storage/sdcard0/doc/1.txt" * * @param pathName * @return */ public static boolean isFileExist(String pathName) { ... 阅读全文
posted @ 2016-12-02 16:08 随缘101 阅读(124) 评论(0) 推荐(0) 编辑

从网络上下载文件到sd卡上

摘要: String SDPATH = Environment.getExternalStorageDirectory() + "/"; String path = SDPATH + "files/"; /** * 此文件支持下载docx,pdf,xls,jpg, * @param urlStr * @param path * @param file... 阅读全文
posted @ 2016-12-02 02:56 随缘101 阅读(341) 评论(0) 推荐(0) 编辑
2016年11月30日

获取edit焦点,打开和关闭软键盘

摘要: 打开: et_search.requestFocus(); et_search.setFocusable(true); et_search.setFocusableInTouchMode(true); InputMethodManager imm = (InputMethodManager) get 阅读全文
posted @ 2016-11-30 09:33 随缘101 阅读(272) 评论(0) 推荐(0) 编辑

Handler机制来处理子线程去更新UI线程控件

摘要: public class HandlerTestActivity extends Activity { private TextView tv; private static final int UPDATE = 0; private Handler handler = new Handler() { @Override public v... 阅读全文
posted @ 2016-11-30 09:22 随缘101 阅读(856) 评论(0) 推荐(0) 编辑

获得某月份的天数

摘要: //获得某月份的天数private int getDaysForMonth(int month) { // month is 0-based if (month == 1) { int x400 = month % 400; if (x400 < 0) { x4... 阅读全文
posted @ 2016-11-30 09:06 随缘101 阅读(212) 评论(0) 推荐(0) 编辑
2016年11月22日

listview选中没有效果

摘要: listview选中没有效果了,设置了android:listselector也没有效果,最后发现是listview中的item布局设置了背景颜色导致,把item的背景色去掉就OK了 http://blog.csdn.net/chenchuntong/article/details/8963630 阅读全文
posted @ 2016-11-22 11:27 随缘101 阅读(248) 评论(0) 推荐(0) 编辑