Skip to content Skip to sidebar Skip to footer

I Am Not Able To Set Multiple Image In Grid View?

I am creating app in which 1.take photo from camera. 2.save its URI in database 3.using cursor and adaptor i retrieve image uri and sets in grid view. i am getting error as ' erro

Solution 1:

Your adapter needs work. WIthin your getView() method you assume the arguments are a URI. IN fact, the arguments are:

public View getView(finalint position, View convertView, final ViewGroup parent){
...
}

The first argument, is the position of the item in the gridview you're about to render. The 2nd is the View - which may be recycled. And the 3rd is the parent of the view. You are trying to take the position, a simple integer, and use that as a URI

What you should be doing within your getView is pulling the image out of your database that corresponds to the "position"th item

See this link here for more information on developing loaders for your adapters

Post a Comment for "I Am Not Able To Set Multiple Image In Grid View?"