main.xml
<?xml version="1.0" encoding="utf-8"?>
"android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
row.xml
<?xml version="1.0" encoding="utf-8"?>
"android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
工具類import android.content.contentvalues;
import android.content.context;
import android.database.cursor;
import android.database.sqlite.sqlitedatabase;
import android.database.sqlite.sqliteopenhelper;
public class dbhelper extends sqliteopenhelper
@override
public void oncreate(sqlitedatabase db)
public void insert(contentvalues values)
public cursor query()
@override
public void onupgrade(sqlitedatabase arg0, int arg1, int arg2)
public void del(int id) );}}
public void close() }}
主activity
查詢activity
public class queryactivity extends listactivity ;
int to = ;
******cursoradapter adapter =
new ******cursoradapter(this, r.layout.row, c, from, to);
listview listview = getlistview();
listview.setadapter(adapter);
final alertdialog.builder builder = new alertdialog.builder(this);
listview.setonitemclicklistener(new onitemclicklistener() {
安卓錄影功能的實現
1 簡介 2 引數初始化 3 開始錄影 4 結束錄影 mediarecorder.setaudiosource mediarecorder.audiosource.camcorder mediarecorder.setvideosource mediarecorder.videosource.cam...
安卓開發之SQLite 資料的增刪改查
sqlite的資料庫中表的增刪改查 下面用新增,刪除,更新,查詢 以下關於一些布局的按鈕就不貼 了.新增 sqlitedatabase中提供了乙個insert 方法,它接受三個引數,第乙個引數是表名 第二個三叔用於在未指定新增資料的情況下給某些可為空的列自動賦值null 第三個引數是乙個conten...
實現安卓應用程式鎖功能
一 實現原理 1.監聽螢幕關閉廣播。2.監聽home鍵廣播。二 實現 public boolean islocked false lockscreenreceiver receiver intentfilter filter override public void oncreate overrid...