/* More lines trying to show * *
public void Updataadapter () {
Get the database phones cursor
Cursor cur = msqlitedatabase.query (table_name, new string[] {table_id, table_num, table_data}, NULL, NULL,
NULL, NULL, NULL);
Micount = Cur.getcount ();
if (cur!= null && cur.getcount () >= 0) {
ListAdapter is a bridge between ListView and backstage data.
ListAdapter adapter = new Simplecursoradapter (This,
Define the display template for each row in the list
Indicates that each row contains two data items
Android. R.layout.simple_list_item_2,
Cursor Object for Database
Cur
Fetching data from the Table_num and table_data two columns of the database
New string[] {table_num, table_data},
Views corresponding to name and number
New int[] {Android. R.id.text1, Android. R.ID.TEXT2});
* * Add adapter to M_listview.
M_listview.setadapter (adapter);
}
}
/* Key Event Processing * *
public boolean onKeyDown (int keycode, keyevent event) {
if (keycode = = Keyevent.keycode_back) {
/* When exiting, do not forget to close * *
Msqlitedatabase.close ();
This.finish ();
return true;
}
Return Super.onkeydown (KeyCode, event);
}
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.