摘要:
浮动搜索框的使用其实并不难,而是在于它的配置非常之繁琐,对于它的使用主要是方便开发者对于程序中有搜索业务时,更好的设计UISearchManager具体使用步骤如下:(1)配置search bar的相关信息,新建一个位于res/xml下的一个searchable.xml的配置文件,如默认值、是否有搜索建议或者语音搜索。代码<searchable xmlns:android=http://schemas.android.com/apk/res/android <!-- label为搜索框上方的文本,hint搜索框里面的提示文本,显示label --> android:label 阅读全文
posted @ 2011-08-18 14:22
SaiWu
阅读(2041)
评论(0)
推荐(0)
摘要:
在论坛以及各大搜索引擎找了半天好不容易找到的,我自己发了个帖子没人搭理,哎,在这里我给大家分享一个CPU使用率的源代码xml文件非常简单就不上了看代码View Code import java.io.IOException;import java.io.RandomAccessFile;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class TextActivity extends Activity {private TextView mytext; /** 阅读全文
posted @ 2011-08-18 14:16
SaiWu
阅读(262)
评论(0)
推荐(0)
摘要:
android会把短信信心保存在数据库中,可查看/dbdata/databases/com.android.providers.telephony/mmssms.db。但是我们不能直接访问数据库,只能通过ContentProvider来访问它。 以下是访问短信数据库的uri content://sms/inbox 收件箱 content://sms/sent 已发送 content://sms/draft 草稿 content://sms/outbox 发件箱 content://sms/failed 发送失败 content://sms/queued 待发送列表 数据库相关字段如下: _i. 阅读全文
posted @ 2011-08-18 14:14
SaiWu
阅读(2346)
评论(0)
推荐(0)
摘要:
View Code public byte[] getPersonPhoto(String PersonID) { String photo_id = null; String[] projection1 = new String[] {ContactsContract.Contacts.PHOTO_ID}; String selection1 = ContactsContract.Contacts._ID+ " = " + PersonID; Cursor cur1 = cr.query( ContactsContract.Contacts.CONTENT_URI, pr 阅读全文
posted @ 2011-08-18 14:13
SaiWu
阅读(4102)
评论(0)
推荐(0)
摘要:
基于Selector的样式来做ListView背景颜色改变,不知道为何选中了的项颜色一直无法保持,一点击就消失(触屏下),上下按钮选中才有保持。解决方法如下:在Activity里定义一个View oldView;View Code inboxListView.setOnItemClickListener(new OnItemClickListener(){public void onItemClick(AdapterView<?> arg0, View arg1,int arg2, long arg3) {arg1.setBackgroundColor(Color.rgb(176, 阅读全文
posted @ 2011-08-18 14:09
SaiWu
阅读(2177)
评论(0)
推荐(0)
摘要:
ArrayAdapter.add();调用这个方法add("为Adapter增加内容")但是出现Caused by: java.lang.UnsupportedOperationException百思不得其解于是在网上找到了原因当您创建您的ArrayAdapter你有没有给它分配一个resizeable名单,因此,当你添加(),它不能递增它的大小,并抛出一个UnsupportedOperationException。尝试这样的事情:List<CharSequence> planets = new ArrayList<CharSequence>(); 阅读全文
posted @ 2011-08-18 14:07
SaiWu
阅读(1795)
评论(0)
推荐(0)
摘要:
View Code protected Dialog onCreateDialog(int id) {switch(id){ case NEWMESSAGEDIALOG: LayoutInflater lf=LayoutInflater.from(this); final View alertView=lf.inflate(R.layout.newmessagedialog, null); final ImageButton newMessageIB=(ImageButton) alertView.findViewById(R.id.newmessageSearch); final EditT 阅读全文
posted @ 2011-08-18 14:06
SaiWu
阅读(779)
评论(0)
推荐(0)
摘要:
INFO/ActivityManager(61): Starting: Intent { cmpXXXXXXXX是因为不同的activity调用xml混乱所致,估计是主要是非启动activity也调用了相同的main.xml 阅读全文
posted @ 2011-08-18 14:04
SaiWu
阅读(537)
评论(0)
推荐(0)
摘要:
因为未完成加载就播放了,应该调用sp.setOnLoadCompleteListener(new OnLoadCompleteListener(){ @Override public void onLoadComplete(SoundPool arg0, int arg1, int arg2) { sp.play(spload, 1, 1, 1, 1, 1); }});监听加载完成后调用播放 阅读全文
posted @ 2011-08-18 14:04
SaiWu
阅读(1419)
评论(0)
推荐(0)
摘要:
一.创建xml文件,位置:drawable/xxx.xml,同目录下要放相关图片View Code <?xml version="1.0" encoding="utf-8" ?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 默认时的背景图片--> <item android:drawable="@drawable/pic1" /> <!-- 没有焦点时的背景 阅读全文
posted @ 2011-08-18 13:53
SaiWu
阅读(663)
评论(0)
推荐(0)

浙公网安备 33010602011771号