How do i pass data from main activity to my database in android -
mainactivity
@override public void onlocationchanged(location location) { log.d(tag, "firing onlocationchanged.............................................."); mcurrentlocation = location; mlastupdatetime = dateformat.gettimeinstance().format(new date()); string lat = string.valueof(mcurrentlocation.getlatitude()); string lng = string.valueof(mcurrentlocation.getlongitude()); }
database.java
public void insertsettings(string lattitude, string longitude) { sqlitedatabase db = getreadabledatabase(); contentvalues values = new contentvalues(); values.put(lattitude, lattitude); values.put(longitude, longitude); db.insertorthrow(locate_table, null, values); }
i need pass string lat , string lng database... new..so pardon mistakes , please help.
Comments
Post a Comment