2

I have a list of orders that is in an arraylist. My problem is, although I can call it, I can't display ALL the elements of the arraylist.

I want to display it after clicking a specific button for example (View my order) and to a new intent/ different class.

Barak
  • 16,117
  • 9
  • 49
  • 84
Soysauce
  • 23
  • 6
  • Your problem is not clear. What do you mean you can't display all the elements?? The typical listview scrolls... it might be best to show your code so we can see what you are trying to do. – Barak Sep 28 '12 at 15:23
  • I'm so sorry, I can call all the elements but I don't know how to display it. I have this if(v.getId()==R.id.btn8){ Intent intent = new Intent(main.this, Finalize.class); for(int i=0;i – Soysauce Sep 28 '12 at 15:25
  • I've tried displaying it on a textview, but it might just overwrite it? – Soysauce Sep 28 '12 at 15:32

1 Answers1

1

You have to use a listview for that. You van create your list view with visibility:hidden and implement an onclickListener to your button which will set the visibility of the list view to visible.

To populate your list view, see: Populating a ListView using an ArrayList?

To make the list view visible:

ListView lv = findViewById(R.id.listView);
lv .setVisibility(View.GONE);
Community
  • 1
  • 1
Miloš
  • 17,005
  • 46
  • 137
  • 240
  • will i declare it on the origin class? or the next class? – Soysauce Sep 28 '12 at 15:47
  • @Soysauce, what's for you the original and the next class? You can create the table in your main activity, it will not add a lot of code. – Miloš Oct 01 '12 at 06:53