English 中文(简体)
如果数据库是空的,如何获得汽车增量?
原标题:How to get auto increment number if database is empty?

在座标中,我有自动加油的浏览量,因此,在 and的 s光数据库中增加3个条目,但说删除数据库中的3个条目,然后加上另一个条目,它将继续从数据库中最后的自动加油号中自动加油,这样,如果数据库中删除所有条目,如果当时数据库中没有留下的话,如何获得最后的自动加油号?

Update

在试图使用“SélectT 最后一_insert_rowid()”时,即装载垃圾:

在数据库档案中:

 public Cursor getmax(){
        return databaseConnect.rawQuery("SELECT last_insert_rowid()", null);
    }

和在档案中,如果回过来,则试图翻一番:

  Cursor reminder = databaseHelper.getmax();
 String title = reminder + "";

i) 需要掩饰像上文一样,但当检查时,会把垃圾带回去?

问题回答

如果是甲型六氯环己烷,就能够使用甲型六氯环己烷。

SELECT last_insert_rowid()

你们总是能够达到一栏顶,并增加一栏。

两种选择:

- “Createa a Databasestart,用于插入,因此,插入一项行动将它刚插入的电网的电网恢复。 储存这种价值与共同的偏好一样。

- 单单单单单单单单凭数据库是空的,而自动加固指数就开始。 如果你想要最后一行的指数,就只插入一行,检查其指数,然后细分。 然后删除空档(相应更新“最后插入指数”)

Trys

String maxValue = "0";
Cursor c = db.rawQuery("SELECT seq FROM sqlite_sequence WHERE sqlite_sequence.name =  MY_TABLE ", null);
if (c != null && c.moveToFirst())
    maxValue = String.valueOf(c.getInt(c.getColumnIndex("seq")));




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签