how to set an auto increment id in Android realm-java? -


do know how set auto incremental id in android realm java,i know realm @ moment doesn't have support built in sq lite.

pass name of model class extending realmobject , change column name "con_id" id field (primary key)of model class.

call method , give 1 id can use insert new record new id.

public static long getuniqueid(realm realm, class classname) {             number number = realm.where(classname).max("con_id");             if (number == null) return 1;             else return (long) number + 1;         } 

Comments

Popular posts from this blog

Multilayer CSV to filtered excel -

Listboxes in c# -

ios - Why must I define variables twice in the Header file? -