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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -