Commit 1dadb1d9 authored by Willard's avatar Willard

Fix wrong reference to service

parent 89301510
......@@ -45,8 +45,6 @@ import retrofit2.converter.gson.GsonConverterFactory;
public class NavDrawerActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
private CanteeneoApiInterface service;
private static Context c;
private DishAdapter adapter;
private ArrayList<Dish> dishes = new ArrayList<>();
......@@ -82,9 +80,9 @@ public class NavDrawerActivity extends AppCompatActivity implements NavigationVi
String message = intent.getStringExtra(LoginActivity.EXTRA_MESSAGE);
Toast.makeText(NavDrawerActivity.this, message, Toast.LENGTH_SHORT).show();
populateFilter(service.getDishTypes(), R.id.type_checkboxes);
populateFilter(service.getCuisines(), R.id.cuisine_checkboxes);
populateFilter(service.getLocations(), R.id.location_checkboxes);
populateFilter(AppUtils.service.getDishTypes(), R.id.type_checkboxes);
populateFilter(AppUtils.service.getCuisines(), R.id.cuisine_checkboxes);
populateFilter(AppUtils.service.getLocations(), R.id.location_checkboxes);
ListView lv = (ListView) findViewById(R.id.listView);
adapter = new DishAdapter(this, dishes);
......@@ -215,7 +213,7 @@ public class NavDrawerActivity extends AppCompatActivity implements NavigationVi
}
private void searchDish(String name) {
Call<List<Dish>> call = service.searchByName(name, getChecked(R.id.type_checkboxes), getChecked(R.id.cuisine_checkboxes), getChecked(R.id.location_checkboxes), 0, 1000);
Call<List<Dish>> call = AppUtils.service.searchByName(name, getChecked(R.id.type_checkboxes), getChecked(R.id.cuisine_checkboxes), getChecked(R.id.location_checkboxes), 0, 1000);
call.enqueue(new Callback<List<Dish>>() {
@Override
public void onResponse(Call<List<Dish>> call, Response<List<Dish>> response) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment