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.

3
  • 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. Commented Sep 28, 2012 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<column.size();i++) { String item = column.get(i); System.out.println(item); } startActivity(intent); } I know that system.out.print will nwork, I want to display it on a list where I can see all the orders. Thanks in advance. :) Commented Sep 28, 2012 at 15:25
  • I've tried displaying it on a textview, but it might just overwrite it? Commented Sep 28, 2012 at 15:32

1 Answer 1

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);
Sign up to request clarification or add additional context in comments.

2 Comments

will i declare it on the origin class? or the next class?
@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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.