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

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -