Here is my menu.java class
public class menu {
private String type;
private String description;
private double price;
public menu(String type, String description, double price) {
this.type = type;
this.description = description;
this.price = price;
}
public String getType() {
return type;
}
public String getDescription() {
return description;
}
public double getPrice() {
return price;
}
And here is my Adapter class
public class menuItems extends AppCompatActivity {
ListView listItems;
TextView textView6;
ArrayList<menu> list;
List selections=new ArrayList();
int count=0;
listItems = (ListView) findViewById(R.id.listItems);
textView6 = (TextView) findViewById(R.id.textView6);
list = new ArrayList<>();
final menu menu1 = new menu("GrayHound", "Atchaar,Chips,2
polony,cheese,beef patty,russian and egg", 32.00);
menu menu2 = new menu("Hummer", "Atchaar,chips,polony,cheese,beef
patty,russian and egg", 26.00);
list.add(menu1);
list.add(menu2);
final ProductAdapter2 adapter = new ProductAdapter2(this, list);
listItems.setAdapter(adapter);
private void doSomethingWithItems(){
TextView tv = (TextView) findViewById(R.id.tvType);
String string = tv.getText().toString();
Intent intent= new Intent(menuItems.this,items.class);
intent.putExtra("user",string);
startActivity(intent);
In the receiving class I've declared
Bundle value=getIntents().getExtras().
String pass=value.toString("user");
textView15.setText(value);
I have created a custom listView with an ImageView and three textViews(tvType,tvDescription,tvPrice).I am getting a problem when I have to pass the tvType to the next activity after the user has clicked on the listView item.It seems I can only pass one item at a time using putExtra intent.I want to pass multiple items not one.
I should be able to select as many items as I want before launching the next activity after pressing of a button. And once there,then all my selected tvType items should be shown.
Any suggestion would be appreciated please,as I have done research into this and still havent found a suitable answer