随笔分类 -  Android

ListView setOnItemClickListener无法响应点击事件解决
摘要:写了个ListView,adapter是implement ListAdapter的,发现无法点击。上网查了资料,1) 如果item当中包括checkbox和button等响应事件的view,那么就不会响应item的点击,把子view设置为不可focus就OK2) 设置了还是没有用,看到网上一哥们写的my problem is now solved and I just want to report the solution, incase someone else is finding the same problem.My implementation of ListAdapter.isE 阅读全文

posted @ 2012-03-06 11:13 lightideal 阅读(1756) 评论(0) 推荐(0)

findViewById 为空的可能原因
摘要:三种可能原因:1) 在setContentView之前调用了,解决方法: 在setContentView之后调用。@Overridepublic void onCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); ListView lv = (ListView)findViewById(R.id.tx); setContentView(R.layout.main); //…}2) findViewById所属的VIew如果是inflater出来的... 阅读全文

posted @ 2012-03-05 19:52 lightideal 阅读(646) 评论(0) 推荐(0)

[转载] convertView&setTag方法的一点理解
摘要:原文地址:http://blog.163.com/freemanls@126/blog/static/164585061201171210504864/前言首先我们要知道setTag方法是干什么的,SK解释为TagsUnlike IDs, tags are not used to identify views. Tags are essentially an extra piece of information that can be associated with a view. They are most often used as a convenience to store data 阅读全文

posted @ 2012-03-05 18:07 lightideal 阅读(176) 评论(0) 推荐(0)

ListView Adapter
摘要:public interfaceListAdaptersimplements Adapterandroid.widget.ListAdapterKnown Indirect SubclassesArrayAdapter<T>, BaseAdapter, CursorAdapter, HeaderViewListAdapter, ResourceCursorAdapter, SimpleAdapter, SimpleCursorAdapter, WrapperListAdapter[转载] http://blog.sina.com.cn/s/blog_7db304660100x2f0 阅读全文

posted @ 2012-03-02 16:25 lightideal 阅读(249) 评论(0) 推荐(0)

JQuery Mobile学习(一)
摘要:鉴于phonegap开发手机应用,Jquery Mobile也必不可少,上官网下载下来JS,短小精悍,很优美的代码。找了个例子,浏览器运行了下,这几行就能实现字体消失的功能了,放到phonegap的html中运行,android手机上也能work啦,继续学习~~<html><head><script type="text/javascript" src="jquery-1.7.1.js"></script><script type="text/javascript">$(do 阅读全文

posted @ 2012-03-01 18:09 lightideal 阅读(230) 评论(0) 推荐(0)

PhoneGap学习之(一) HelloWorld
摘要:今天照着文档,PhoneGap的HelloWorld诞生了~~~so easy! http://phonegap.com/start#android总结下步骤:1) 装好Android开发的各类武器: Eclipse, Android SDK, ADT, 下载PhoneGap包2) 新建一个Android Project, 将X.jar copy到lib下,X.js copy到asserts/www, xml文件夹copy到res下3) 改主类:a) extends DroidGap b) 将setContentView(R.layout.main); ===> super.load.. 阅读全文

posted @ 2012-03-01 17:15 lightideal 阅读(343) 评论(0) 推荐(0)

导航