From 0d341638ef3a1cad50778330a832ffdc66732daa Mon Sep 17 00:00:00 2001 From: Georg Reisinger <43533139+GeorgReisinger@users.noreply.github.com> Date: Wed, 13 Feb 2019 11:13:23 +0100 Subject: [PATCH] Change von Pos zu sl_id --- .../activitys/ShoppinglistDetails.java | 20 +++++-------- .../shoppinglist/ShoppinglistAdapter.java | 29 ++++++++++--------- app/src/main/res/menu/dash_menu.xml | 3 ++ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/at/smartshopper/smartshopper/activitys/ShoppinglistDetails.java b/app/src/main/java/at/smartshopper/smartshopper/activitys/ShoppinglistDetails.java index 03e963e..84df056 100644 --- a/app/src/main/java/at/smartshopper/smartshopper/activitys/ShoppinglistDetails.java +++ b/app/src/main/java/at/smartshopper/smartshopper/activitys/ShoppinglistDetails.java @@ -52,29 +52,25 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr colorBtn = (Button) findViewById(R.id.groupColor); Bundle bundle = getIntent().getExtras(); - int position = -1; // or other values + String sl_id = null; // or other values if (bundle != null) - position = bundle.getInt("pos"); + sl_id = bundle.getString("sl_id"); - Toast.makeText(this, "Click detected on item " + position, Toast.LENGTH_LONG).show(); + //Toast.makeText(this, "Click detected on item " + position, Toast.LENGTH_LONG).show(); - List shoppinglists = null; try { - shoppinglists = db.getMyShoppinglists(FirebaseAuth.getInstance().getCurrentUser().getUid()); - } catch (JSONException e) { - e.printStackTrace(); + Shoppinglist shoppinglist = db.getShoppinglist(sl_id); } catch (SQLException e) { e.printStackTrace(); + } catch (JSONException e) { + e.printStackTrace(); } - - Shoppinglist aktuelleShopinglist = shoppinglists.get(position); - - final String sl_id = aktuelleShopinglist.getSlId(); + final String finalSl_id = sl_id; fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { try { - showPupupGroupEdit(false, null, sl_id, v); + showPupupGroupEdit(false, null, finalSl_id, v); } catch (SQLException e) { e.printStackTrace(); } catch (JSONException e) { diff --git a/app/src/main/java/at/smartshopper/smartshopper/shoppinglist/ShoppinglistAdapter.java b/app/src/main/java/at/smartshopper/smartshopper/shoppinglist/ShoppinglistAdapter.java index cf751a8..dc7e6b3 100644 --- a/app/src/main/java/at/smartshopper/smartshopper/shoppinglist/ShoppinglistAdapter.java +++ b/app/src/main/java/at/smartshopper/smartshopper/shoppinglist/ShoppinglistAdapter.java @@ -77,7 +77,21 @@ public class ShoppinglistAdapter extends RecyclerView.Adapter +