摘要: 开始在手机上开发应用了。但是发现与机顶盒不一样,手机因为电池使用有限,所以隔段时间会锁屏,很影响开发以及使用。今天在网上查了些资料,代码上实现“禁止锁屏,保持高亮”大致有以下几种方法: 1、在每个Activity中的onCreate()中加入代码: @Overrideprotected void onCreate(Bundle savedInstanceState) { super.o... 阅读全文
posted @ 2012-07-19 10:56 风倾清凌 阅读(11316) 评论(0) 推荐(1) 编辑
摘要: Exit exit = new Exit(); @Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { pressAgainExit(); return true; } return super.onKe... 阅读全文
posted @ 2012-07-16 11:13 风倾清凌 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 原因分析:android要求所有的程序必须有签名,否则就不会安装该程序。在我们开发过程中,adt使用debug keystore,在 preference->android->buid中设置。debug的keystore默认有效期为一年,如果你是从一年前开始完android程序,那么在一年后导入这个app的时候很可能出现debug keystore过期,导致你无法生成 apk文件。此时你只要删除d... 阅读全文
posted @ 2012-07-12 10:38 风倾清凌 阅读(370) 评论(0) 推荐(0) 编辑
摘要: It looks like some (most?) HTC phones running Android, such as my HTC EVO, are not capable of receiving multicast or broadcast datagram packets over the Wi-Fi network. This means that apps which rely on such communication will fail, often with no indication of the problem. From the app's perspec 阅读全文
posted @ 2012-05-17 11:37 风倾清凌 阅读(932) 评论(0) 推荐(0) 编辑
摘要: 原文地址: http://tdq222.iteye.com/blog/701161 注: 在Activity中有 getFileDir() 和 getCacheDir(); 方法可以获得当前的手机自带的存储空间中的当前包文件的路径 getFileDir() ----- /data/data/cn.xxx.xxx(当前包)/files getCacheDir() ----- /data/data/c... 阅读全文
posted @ 2012-04-28 17:41 风倾清凌 阅读(12671) 评论(1) 推荐(0) 编辑
摘要: 1、错误提示: A resource exists with a different case: /text/bin/com/test'.". Fix the problem, then try refreshing this project and building it since it may be inconsistent解决办法:一般出现这种情况,是因为你建立的工程名称与bin目... 阅读全文
posted @ 2012-04-09 11:33 风倾清凌 阅读(1282) 评论(0) 推荐(0) 编辑
摘要: android自带的RadioButton样式实在是不好看。如果只是需要修改RadioButton前面的圆圈样式,则: (1)在drawable文件夹下增加文档myradiobutton.xml,描述button在各个状态下得图片: <?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.and... 阅读全文
posted @ 2012-02-14 18:17 风倾清凌 阅读(6795) 评论(1) 推荐(0) 编辑
摘要: 参考文献:http://blog.csdn.net/lhs286266503/article/details/6996981http://archive.cnblogs.com/a/2176653/Dialog不同于view/PopupWindow,如果需要更改Dialog显示的位置,一般是更新窗口显示,直接上代码吧。与PopupWindow一样,显示定义相关的动画文件:(1)定义动画文件在res/anim文件夹下定义相关的动画xml文件,可参考【android】动画效果研究(view)【1】(2)定义style.xml文件在res/value文件夹下定义style.xml文件,可参考【and 阅读全文
posted @ 2012-01-18 16:59 风倾清凌 阅读(8778) 评论(0) 推荐(0) 编辑
摘要: 如果硬件或者底层不支持style,那么【android】动画效果研究(PopupWindow)【3】的方法完全不起作用。在【android】动画效果研究(view/PopupWindow)【2】 没研究之前,一直苦于不知道如何增加popupwindow的动画效果。然后突然看到了ViewFlipper…参考文献:http://www.cnblogs.com/glony/articles/2163877.html(1)定义动画文件 与【android】动画效果研究(view)【1】一样,也使用Animation类,对于该类中几种动画效果的定义以及使用,可参加【android】动画效果研究(vie. 阅读全文
posted @ 2012-01-18 16:30 风倾清凌 阅读(2411) 评论(1) 推荐(0) 编辑
摘要: 因为PopupWindow不同于view,它不提供setAnimation接口,所以不可使用【android】动画效果研究(view)【1】中所使用的方法。但Android提供了PopupWindow.setAnimationStyle方法。参考文献:http://gqdy365.iteye.com/blog/1007282(1)定义动画文件 与一样,也使用Animation类,对于该类中几种动画效果的定义以及使用,可参加【android】动画效果研究(view)【1】,这里不再重复。也可以参考以上文献。(2)定义style.xml文件 popupwindow的效果要在style中定义相应的. 阅读全文
posted @ 2012-01-18 16:23 风倾清凌 阅读(5042) 评论(1) 推荐(0) 编辑