Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public int getIDmax() {
- int MAX =0;
- SQLiteDatabase db = this.getReadableDatabase();
- try{
- String QUERY = "SELECT MAX(KEY_MESSAGE_ID) AS KEY_MESSAGE_ID FROM "+TABLE_NAME ;
- Cursor cursor = db.rawQuery(QUERY,null);
- MAX =cursor.getColumnIndex(KEY_MESSAGE_ID);
- db.close();
- return MAX;
- }catch (Exception e){
- Log.e("error",e+"");
- }
- return 0;
- }
- int b = handler.getIDmax();
- Toast.makeText(getApplicationContext(),""+b,Toast.LENGTH_LONG).show();
Add Comment
Please, Sign In to add comment