I want to get id from database and use it in other class in Android app -


in database have written following code id.

public int getid(){        string[] columns = new string[]{id};               cursor c=ourdb.query(table_name, columns, null, null, null, null, null);         if(c.getcount()==0)             return 1;         c.movetolast();         int id=c.getint(0);         return id+1;     } 

and in class did

int id = info.getid(); 

but id not incrementing after each entry , stays 1.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -