Change von Pos zu sl_id
This commit is contained in:
		@@ -52,29 +52,25 @@ public class ShoppinglistDetails extends Activity implements DetailsAdapter.OnGr
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        colorBtn = (Button) findViewById(R.id.groupColor);
 | 
					        colorBtn = (Button) findViewById(R.id.groupColor);
 | 
				
			||||||
        Bundle bundle = getIntent().getExtras();
 | 
					        Bundle bundle = getIntent().getExtras();
 | 
				
			||||||
        int position = -1; // or other values
 | 
					        String sl_id = null; // or other values
 | 
				
			||||||
        if (bundle != null)
 | 
					        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<Shoppinglist> shoppinglists = null;
 | 
					 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            shoppinglists = db.getMyShoppinglists(FirebaseAuth.getInstance().getCurrentUser().getUid());
 | 
					            Shoppinglist shoppinglist = db.getShoppinglist(sl_id);
 | 
				
			||||||
        } catch (JSONException e) {
 | 
					 | 
				
			||||||
            e.printStackTrace();
 | 
					 | 
				
			||||||
        } catch (SQLException e) {
 | 
					        } catch (SQLException e) {
 | 
				
			||||||
            e.printStackTrace();
 | 
					            e.printStackTrace();
 | 
				
			||||||
 | 
					        } catch (JSONException e) {
 | 
				
			||||||
 | 
					            e.printStackTrace();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        final String finalSl_id = sl_id;
 | 
				
			||||||
        Shoppinglist aktuelleShopinglist = shoppinglists.get(position);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        final String sl_id = aktuelleShopinglist.getSlId();
 | 
					 | 
				
			||||||
        fab.setOnClickListener(new View.OnClickListener() {
 | 
					        fab.setOnClickListener(new View.OnClickListener() {
 | 
				
			||||||
            @Override
 | 
					            @Override
 | 
				
			||||||
            public void onClick(View v) {
 | 
					            public void onClick(View v) {
 | 
				
			||||||
                try {
 | 
					                try {
 | 
				
			||||||
                    showPupupGroupEdit(false, null, sl_id, v);
 | 
					                    showPupupGroupEdit(false, null, finalSl_id, v);
 | 
				
			||||||
                } catch (SQLException e) {
 | 
					                } catch (SQLException e) {
 | 
				
			||||||
                    e.printStackTrace();
 | 
					                    e.printStackTrace();
 | 
				
			||||||
                } catch (JSONException e) {
 | 
					                } catch (JSONException e) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -77,7 +77,21 @@ public class ShoppinglistAdapter extends RecyclerView.Adapter<ShoppinglistAdapte
 | 
				
			|||||||
        //binding the data with the viewholder views
 | 
					        //binding the data with the viewholder views
 | 
				
			||||||
        holder.textViewTitle.setText(shoppinglist.getname());
 | 
					        holder.textViewTitle.setText(shoppinglist.getname());
 | 
				
			||||||
        System.out.println(shoppinglist.getname());
 | 
					        System.out.println(shoppinglist.getname());
 | 
				
			||||||
        holder.textViewBeschreibung.setText(shoppinglist.getdescription());
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        holder.itemView.setOnClickListener(new View.OnClickListener() {
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public void onClick(View v) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                Intent intent = new Intent(v.getContext(), ShoppinglistDetails.class);
 | 
				
			||||||
 | 
					                Bundle bundle = new Bundle();
 | 
				
			||||||
 | 
					                bundle.putString("sl_id", shoppinglist.getSlId());
 | 
				
			||||||
 | 
					                intent.putExtras(bundle);
 | 
				
			||||||
 | 
					                v.getContext().startActivity(intent);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        holder.bearbeiten.setOnClickListener(new View.OnClickListener() {
 | 
					        holder.bearbeiten.setOnClickListener(new View.OnClickListener() {
 | 
				
			||||||
            @Override
 | 
					            @Override
 | 
				
			||||||
@@ -186,20 +200,7 @@ public class ShoppinglistAdapter extends RecyclerView.Adapter<ShoppinglistAdapte
 | 
				
			|||||||
            del = itemView.findViewById(R.id.deleteShoppinglist);
 | 
					            del = itemView.findViewById(R.id.deleteShoppinglist);
 | 
				
			||||||
            shoppinglistColor = itemView.findViewById(R.id.shoppinglistColor);
 | 
					            shoppinglistColor = itemView.findViewById(R.id.shoppinglistColor);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            itemView.setOnClickListener(new View.OnClickListener() {
 | 
					 | 
				
			||||||
                @Override
 | 
					 | 
				
			||||||
                public void onClick(View v) {
 | 
					 | 
				
			||||||
                    int position = getAdapterPosition();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    Intent intent = new Intent(v.getContext(), ShoppinglistDetails.class);
 | 
					 | 
				
			||||||
                    Bundle bundle = new Bundle();
 | 
					 | 
				
			||||||
                    bundle.putInt("pos", position);
 | 
					 | 
				
			||||||
                    intent.putExtras(bundle);
 | 
					 | 
				
			||||||
                    v.getContext().startActivity(intent);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,9 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="utf-8"?>
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
					<menu xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
				
			||||||
    xmlns:android="http://schemas.android.com/apk/res/android">
 | 
					    xmlns:android="http://schemas.android.com/apk/res/android">
 | 
				
			||||||
 | 
					    <item
 | 
				
			||||||
 | 
					        android:id="@+id/ocrBtn"
 | 
				
			||||||
 | 
					        android:title="Rechnung Scanen" />
 | 
				
			||||||
    <item
 | 
					    <item
 | 
				
			||||||
        android:id="@+id/logoutBtn"
 | 
					        android:id="@+id/logoutBtn"
 | 
				
			||||||
        android:title="Logout"
 | 
					        android:title="Logout"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user