• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Endless Views

Maxood

Lurker
I am developing an application in which a user keeps on scrolling
vertically. Each view displays a single text on a drawable background.
How can i obtain endless views?
Is it a ListView do i have to use here? But how can i make a ListView
not to end and keep on going forever until the application is
terminated by the user?
Is there an attribute or i have to do it programatically? Please
explain.
Hope my question is clear.Waiting for the reply.

Maxood
 
No idea how to do it, but why on earth would you need it to scroll infinitely?
 
There are 636 facts in total. Each fact is fetched from the database randomly and displayed on the view.There are 27 drawables (background images) on which each fact will be displayed. These drawables are meant to repeat themselves randomly or sequentially.

I need infinite scrolling as the facts and views keep on repeating them as the user scrolls vertically.
Hope you understand my requirement. This is the layout i have made.



Now i need to have these views repeating them. How can i do that?Thanks

Maqsood
 
I'm still in my early phase of learning Java, but I would imagine it may be best to set the visual template of what you want and populate the background image and on screen data using a while that just never reaches it's conclusion.

I would do it using someting like
Code:
while (true statement) {
    randomly.display.fact 
}
Your 'true statement' could just be that the next fact has been called for. While it's not technically infinite (in the sense it'll just keep running and eat up your memory and crash), it just always keeps going and you can create a function to randomly select a number/id/name/fact/whatever for the data to display. Maybe include an array that is storing the last 50 or so shown facts that you can check the randomly generated fact against so that they don't repeat too often. So I can't be more help with actual code, but that's the logic I'd approach this with, hope it helps!
 
Have you had any luck implementing this in terms of just being able to show 600 odd entries?

I don't require the list to loop, but need to show a vast amount of data and memory is a big factor.

I'll let you know if I come up with / find a good solution that might be relevant to your needs.

Matt
 
Back
Top Bottom