Commit 1788d15b authored by Willard's avatar Willard

Fix wrong dish being opened when selecting from a filtered list

parent a1ee6884
......@@ -35,7 +35,7 @@ public class DishAdapter extends BaseAdapter {
@Override
public long getItemId(int position) {
return position;
return filteredDishes.get(position).getId();
}
@Override
......
......@@ -72,7 +72,7 @@ public class NavDrawerActivity extends AppCompatActivity implements NavigationVi
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent i = new Intent(NavDrawerActivity.this, DishViewActivity.class);
Dish d = dishes.get(position);
Dish d = adapter.getItem(position);
i.putExtra("ID", d.getId());
i.putExtra("NAME", d.getName());
i.putExtra("PRICE", d.getPrice());
......
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