上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 45 下一页
  2012年3月31日
摘要: Content ProvidersIn this documentContent provider basicsQuerying a content providerModifying data in a providerCreating a content providerContent URI summaryKey classesContentProviderContentResolverCursorContent providers store and retrieve data and make it accessible to all applications. They'r 阅读全文
posted @ 2012-03-31 11:59 lee0oo0 阅读(642) 评论(0) 推荐(0) 编辑
  2012年3月30日
摘要: 显示网页1.Uriuri=Uri.parse("http://google.com");2.Intentit=newIntent(Intent.ACTION_VIEW,uri);3.startActivity(it);显示地图1.Uriuri=Uri.parse("geo:38.899533,-77.036476");2.Intentit=newIntent(Intent.ACTION_VIEW,uri);3.startActivity(it);4.//其他geoURI範例5.//geo:latitude,longitude6.//geo:latitud 阅读全文
posted @ 2012-03-30 10:04 lee0oo0 阅读(149) 评论(0) 推荐(0) 编辑
  2012年3月29日
摘要: 第一个程序的: SharedPreferences preferences = getSharedPreferences("count", MODE_WORLD_READABLE);第二个程序的: // 获取其他程序所对应的Context Context useCount = createPackageContext("org.crazyit.io", Context.CONTEXT_IGNORE_SECURITY); SharedPreferences prefs = useCount.getSharedPreferences("count& 阅读全文
posted @ 2012-03-29 23:38 lee0oo0 阅读(1740) 评论(0) 推荐(0) 编辑
摘要: 写: 1. 通过getSharedPreferences得到SharedPreferences对象;传入的第一个参数是string类型的名字,传入的第二个参数可以为MODE_WORLD_READABLE或者MODE_WORLD_WRITEABLE 2. 使用该对象的edit方法得到SharedPreferences.edit对象 3.可以使用各种put方法,例如是putString传入数据 4. 这里顺便说一下SimpleDateFormat类, 以下是例子 SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 " 阅读全文
posted @ 2012-03-29 21:12 lee0oo0 阅读(1109) 评论(0) 推荐(0) 编辑
摘要: 注意:我们创建Handler的对象调用post方法,然后传递进去一个Runnable对象的这种方式并不会创建一个新的线程。 HandlerThread和Looper :HandlerThread是Thread的子类 以下是应用框架: 1. 首先创建HandlerThread对象 2.对用HandlerThread对象的start方法启用新线程 3. 创建一个类继承Handler,调用含有Looper的构造函数 public class MyHandler extendsHandler{ publicMyHandler (Looper looper){ super(looper)... 阅读全文
posted @ 2012-03-29 15:15 lee0oo0 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 一直对Handler有所疑惑,今天做出决心要搞懂,现在粗略讲讲心得。 Handler拥有两个队列,一个是放线程的队列,我们就暂且叫做线程队列;而另外一个是放消息的队列,我们暂且叫做消息队列。 创建线程的方法在Java当中有两种,一种是继承Thread而另外的一种则是实现Runnable。在Android中我们比较常用的是实现Runnable,然后可以通过Handler的post方法或者是postDelayd方法把线程添加到线程队列当中。当需要停止的时候的是调用Handler的removeCallBacks方法。 说道消息队列,我们通过在Runnable中Handler的obtainMess.. 阅读全文
posted @ 2012-03-29 15:13 lee0oo0 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 以下是代码下载地址,代码中有注释/Files/lee0oo0/MyDictionaryTest.rar 阅读全文
posted @ 2012-03-29 11:42 lee0oo0 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 1. 首先在res/raw中导入文件dictionary.db/Files/lee0oo0/dictionary.rar2. main.xml文件的布局<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent 阅读全文
posted @ 2012-03-29 11:14 lee0oo0 阅读(2124) 评论(1) 推荐(0) 编辑
摘要: Tab LayoutTo create a tabbed UI, you need to use aTabHostand aTabWidget. TheTabHostmust be the root node for the layout, which contains both theTabWidgetfor displaying the tabs and aFrameLayoutfor displaying the tab content.You can implement your tab content in one of two ways: use the tabs to swapV 阅读全文
posted @ 2012-03-29 09:39 lee0oo0 阅读(947) 评论(0) 推荐(0) 编辑
  2012年3月26日
摘要: 这是ExpandableList的使用效果:/**对SimpleExpandableListAdapter参数的解释 * 使用SimpleExpandableListAdapter显示ExpandableListView * 参数1.上下文对象Context * 参数2.一级条目目录集合 * 参数3.一级条目对应的布局文件 * 参数4.fromto,就是map中的key,指定要显示的对象 * 参数5.与参数4对应,指定要显示在groups中的id * 参数6.二级条目目录集合 * 参数7.二级条目对应的布局文件 * 参数8... 阅读全文
posted @ 2012-03-26 10:53 lee0oo0 阅读(1528) 评论(0) 推荐(0) 编辑
上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 45 下一页