1

I've got a recyclerView with items that I get from a MySQL database. Now I want that the user can touch one of those items and "save" it locally. This saved item should be add in another recyclerView layout called "My saved items". This is my code so far:

recyclerViewadapter_artikel = new RecyclerViewKyoceraArtikel(GetDataAdapter1, this);

recyclerView.setAdapter(recyclerViewadapter_artikel);



    recyclerView.addOnItemTouchListener( 
            new RecyclerItemClickListener(this, new RecyclerItemClickListener.OnItemClickListener() {
                @Override public void onItemClick(final View view, int position) {


                    AlertDialog.Builder builder = new AlertDialog.Builder(Artikel.this);
                    builder.setItems(new CharSequence[]
                                    {"Copy", "Save", "Open"},
                            new DialogInterface.OnClickListener() {
                                public void onClick(DialogInterface dialog, int which) {
                                    // The 'which' argument contains the index position
                                    // of the selected item
                                    switch (which) {
                                        case 0:

                                            break;
                                        case 1:

                                            break;
                                        case 2:
                                        Intent myIntent = new Intent(view.getContext(), Artikel.class);
                                        startActivityForResult(myIntent, 0);
                                            break;

                                    }
                                }
                            });
                    builder.create().show();
                }

            }));

In case 1 the user should have the opportunity to save this item.

Flerius
  • 11
  • 3

0 Answers0