Snowberg

 

2012年7月27日

新建Android项目时使用project from existing source导入已经存在的项目报 AndroidManifest.xml file missing错误解决方案

摘要: 出错经过 为了查看<sdk>/platforms/<android-version>/samples/文件夹下的Android自带的经典例子,于是将要看的例子导入到eclipse的workspace当中,在利用eclipse的import功能将项目导入到eclipse,但是报了“no projects found to import”的错误,于是乎使用new->java project->create project from existing source重新导入新数据,这次项目正常导入了,但是报了“AndroidManifest.xml file mis 阅读全文

posted @ 2012-07-27 10:26 Snowberg 阅读(5263) 评论(0) 推荐(0) 编辑

2012年7月26日

Android开发总结

摘要: 改变适配器Adapter内容时不要在后台线程中,必须在UI线程中处理,这点可以通过Handler传出来解决。尝试Adapter的notifyDataSetChanged()方法,当然主要看你代码的具体情况。ActivityGroup对子A的管理是通过Map的方式来管理的,在启动子Activity时,对每个子Activity都分配了一个ID号。这种映射的机制使得我们可以通过ID来获取到子A的实例。当遇到AlertDialog.Builder builder = new Builder(this);不显示对话框时,使用AlertDialog.Builder builder = new Builde 阅读全文

posted @ 2012-07-26 21:05 Snowberg 阅读(341) 评论(0) 推荐(0) 编辑

2012年7月25日

ListView中Spinner的使用

摘要: 由于项目的需要,要给用户显示一列表单项,让用户选择,之前使用LinerLayout加Button实现,费时费力,而且表现的内容都已经是写好的内容,对于内容可变的情况下,毫无招架之力。因此在新的项目当中使用了向ListView加入Spinner的方式来表现表单。开发过程中遇到些问题。 一、 遇到的问题: 1、对于Spinner状态的保持。 2、对Spinner做了相应事件之后,对于ListView的OnItemClick事件的相应的处理。 二、 问题的解决: 第一个问题在于,ListView侧重于对数据的表现,而对数据的交互方面是比较差的,因为随着ListVie... 阅读全文

posted @ 2012-07-25 16:56 Snowberg 阅读(4940) 评论(0) 推荐(0) 编辑

2012年7月23日

关于使用反射机制得到泛型的字段名的问题

摘要: 1、实体类public class LSLSEntry { private String storeguid; private String checkguid; private String isstoprunning; public String _5801; public String _5802; public String _5803; public String _6001; public String _6002; public String _6003; public String _6101; public String _6201; public S... 阅读全文

posted @ 2012-07-23 22:11 Snowberg 阅读(565) 评论(0) 推荐(0) 编辑

2012年7月22日

Android统计绘图工具

摘要: 下一个项目可能会用到,记录一下。1、chartdroid(http://code.google.com/p/chartdroid/)2、AndroidPlot(http://androidplot.com/wiki/Home)3、AChartEngine(http://code.google.com/p/achartengine/)4、aiCharts(http://www.artfulbits.com/products/android/aicharts.aspx)5、Java4Less (http://www.java4less.com/charts/chart.php?info=andro 阅读全文

posted @ 2012-07-22 22:41 Snowberg 阅读(394) 评论(0) 推荐(0) 编辑

2012年7月19日

listView当中有嵌套了有onClickListener的控件时ListView自身的onItemClick无响应的解决方案

摘要: android:descendantFocusabilityDefines the relationship between the ViewGroup and its descendants when looking for a View to take focus.Must be one of the following constant values.ConstantValueDescriptionbeforeDescendants0The ViewGroup will get focus before any of its descendants.afterDescendants1Th 阅读全文

posted @ 2012-07-19 10:25 Snowberg 阅读(734) 评论(0) 推荐(0) 编辑

2012年7月15日

android:screenOrientation的说明

摘要: 在Android的官方文档当中,对android:screenOrientation的说明如下:android:screenOrientationThe orientation of the activity's display on the device.The value can be any one of the following strings:"unspecified"The default value. The system chooses the orientation. The policy it uses, and therefore the c 阅读全文

posted @ 2012-07-15 20:12 Snowberg 阅读(45249) 评论(0) 推荐(1) 编辑

2012年7月13日

File.mkdir()与File.mkdirs()

摘要: 一天半调试时间,一些列的错误仅仅源于使用了mkdir()而没有使用mkdirs()。谨记!客户反馈,程序不能正常更新,于是拿出程序来仔细研究之前的代码,重新审视了 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />像这样的权限代码,没问题,而就是更新不下来。出现进度条一闪而 阅读全文

posted @ 2012-07-13 09:47 Snowberg 阅读(1831) 评论(0) 推荐(0) 编辑

2012年7月10日

android:windowSoftInputMode的说明

摘要: 在Android的官方文档当中,对windowSoftInputMode的说明如下:android:windowSoftInputModeHow the main window of the activity interacts with the window containing the on-screen soft keyboard. The setting for this attribute affects two things:The state of the soft keyboard — whether it is hidden or visible — when the act 阅读全文

posted @ 2012-07-10 20:10 Snowberg 阅读(2261) 评论(0) 推荐(0) 编辑

2012年7月8日

设计模式总结

摘要: 一、设计模式的定义设计模式(Design Pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结,使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代码可靠性。二、设计模式的基本要素设计模式一般有如下几个基本要素:模式名称、问题、目的、解决方案、效果、实例代码和相关设计模式,其中的关键元素包括以下四个方面:模式名称 (Pattern name)问题 (Problem)解决方案 (Solution)效果 (Consequences)三、设计模式的分类根据其目的(模式是用来做什么的)可分为创建型(Creational),结构型(Structural)和行为型(B 阅读全文

posted @ 2012-07-08 20:12 Snowberg 阅读(224) 评论(0) 推荐(0) 编辑

导航