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);
}
我需要将字符串lat和字符串lng传递给数据库...我是新的......所以请原谅我的错误并请求帮助。