use of com.djalel.android.bilal.databases.LocationsDBHelper in project Bilal by cdjalel.
the class SearchCityActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search_city);
setTitle(getString(R.string.app_name));
mDBHelper = new LocationsDBHelper(this);
mDBHelper.openReadable();
mLanguage = UserSettings.getLanguage(this).toUpperCase(Locale.ENGLISH);
SearchView searchView = findViewById(R.id.search_city_box);
searchView.setOnQueryTextListener(this);
searchView.setIconified(false);
// XML tag has a bug
searchView.setQueryHint(getString(R.string.search_city));
// Get the intent, verify the action and get the query
Intent intent = getIntent();
Timber.i("onCreate: intent.action = " + intent.getAction());
handleIntent(getIntent());
}
use of com.djalel.android.bilal.databases.LocationsDBHelper in project Bilal by cdjalel.
the class UserSettings method updateCity.
private static City updateCity(Context context, String language) {
City city = getCity(context);
if (null != city) {
LocationsDBHelper dbHelper = new LocationsDBHelper(context);
dbHelper.openReadable();
city = dbHelper.getCity(city.getId(), language.toUpperCase());
dbHelper.close();
if (null != city) {
saveCity(context, city);
return city;
}
}
return null;
}
Aggregations