public class SearchableActivity extends ListActivity {
String options[]={"got nothing here "};
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/*
Uri uriSMSURI = Uri.parse("content://sms/inbox");
Cursor cur = getContentResolver().query(uriSMSURI,new String[] { "_id", "thread_id", "address", "person","date", "body" }, null, null,null);
int i=0;
if(cur.getCount()>0) {
while(cur.moveToNext()) {
String smsBody = cur.getString(5);
options[i++]=smsBody;
}
} else {
options[0]="got nothing here ";
}
cur.close();
*/
setListAdapter(new ArrayAdapter<String(this,android.R.layout.simple_list_item_1, options));
}
注释 /**/ 中的代码使应用程序崩溃。
AVD收件箱默认是空的吗?
如果是,那么我该如何向它提供一些消息?