android中怎樣在sqlite中建立資料庫然後在該數

時間 2021-12-22 13:46:25

1樓:勇敢就酷

很久沒碰android了,android表中第一個欄位應該不能用userid吧,我沒記錯第一個自增長的id是不是_id啊,你改改,至於第一個為什麼建立成功了我真不知道,按你這種寫法第一個也挺玄乎。

2樓:千鋒教育

public class dbopenhelper extends sqliteopenhelper

@override

public void oncreate(sqlitedatabase db)

}這個是android預設的資料庫操作類,可以可以獲得資料庫操作物件,第一次使用時會呼叫oncreate方法,建立**。第二次進行將不會被重複呼叫。

3樓:流行**愛好者

在 public void onupgrade(sqlitedatabase db, int oldversion, int newversion)

這裡面建立 更新數資料庫 再建立一張表 就可以了 建立表的方法 和開始一樣

...........

this.helper = new sundatabasehelper(context);

this.db = this.helper.getwritabledatabase();

this.helper.onupgrade(this.db, 1, 2);

........

你懂得 不解釋

4樓:匿名使用者

外面先套個try catch 斷點除錯看下exception那裡的資訊是什麼,發來瞧瞧,具體問題具體分析

android怎樣在程式中設定TextView中顯示的值

墨汁諾 具體操作如下 button bt button findviewbyid r.id.button1 textview tx textview findviewbyid r.id.textview1 tx.settext bt.gettext gettext 就是獲取按鈕上的文字,在textv...

android中關於service在manifestml檔案中註冊的

這個不是service引起的,是因為你的 中有做activity跳轉,沒有找到跳轉至的activity,你沒有配置該activity. androidmanifest.xml 是每個android程式中必須的檔案。它位於整個專案的根目錄,描述了package中暴露的元件 activities,ser...

怎樣禁掉Android中EditText控制元件的貼上功能

中 edittext et new edittext mcontext et.setenabled false 佈局檔案中 android enabled false 怎樣禁掉android中edittext控制元件的貼上功能 中 edittextet newedittext mcontext et...