p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning Android Application Development (http://p2p.wrox.com/forumdisplay.php?f=631)
-   -   Basic GridView Question (http://p2p.wrox.com/showthread.php?t=86045)

norwell December 15th, 2011 04:03 PM

Basic GridView Question
Hi, I'm a newbie. My question is this: is there a way to build a GridView dynamically? In the example in the book, we are told to place images in the "drawable" directory, and the grid is built from that. How do we build a grid "on the fly"? Do we copy images to the "drawable" directory, or do we write a custom view for that? My aim is to create a grid of thumbnails of the photos on the phone. Thanks.

mudskipper December 16th, 2011 07:39 PM

It may well be that later chapters will indicate a way.

norwell December 18th, 2011 05:38 PM

It turns out that Android has a number of predefined content providers, one of which is for images and one for thumbnails (either internally or externally on the SD card). Also, the Activity class has a predefined method which will retrieve a database cursor for the data in a given content provider. This cursor can then be used to create an adapter which will link the image data to the grid layout. Pretty funky.

All times are GMT -4. The time now is 04:11 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.