Questions tagged [android-gridview]

GridView is a subclass of AdapterView that displays items in a two-dimensional, scrollable grid.

GridView is a subclass of AdapterView that displays items in a two-dimensional, scrollable grid. The grid items are automatically inserted to the layout using a ListAdapter. The cell-data binding is made through an Adapter.

Reference

1619 questions
18
votes
8 answers

How to remove the space between rows of grid view in android

In android grid view there is extra space between the rows of grid view. I am not adding any space to the gridview. here is my xml files
Dipali
  • 1,118
  • 3
  • 13
  • 23
18
votes
6 answers

android grid view place items from right to left

I'm working on an android application with arabic version. In one of the interfaces, I have gridView. So to display items in the correct order, I have to display items in the GridView from the right to the left (and of corse from the top to the…
18
votes
3 answers

java.lang.illegalstateexception could not find a method (view) in the activity class android fragment

in my program, i am using a gridview with some images, i want to show a menu when user tapped on an image in gridview, and then select an action to do from the menu showed. here is my codes: package Kazemi.Alireza.scada; import…
user1793700
  • 219
  • 1
  • 2
  • 9
16
votes
3 answers

Add an array of buttons to a GridView in an Android application

I have an application that will have 5-15 buttons depending on what is available from a backend. How do I define the proper GridView layout files to include an array of buttons that will each have different text and other attributes? Each button…
Tai Squared
  • 11,923
  • 24
  • 70
  • 82
16
votes
3 answers

Infinite scroll of finite items

I have a GridView that has items inside 5x50. I need to scroll them in all directions and instead of stopping when reached the end just start from the top/left. for example left-to-right scroll before scroll 1 2 3 4 5 6 7 8 9 10 after scroll to the…
16
votes
3 answers

Android - RecyclerView spacing between items in a Grid

In my Android app I'm using a RecyclerView to display items in a grid by using a GridLayoutManager. In a GridView, in order to specify the spacing between elements, I would set the horizontalSpacing and verticalSpacing properties. So, how can I do…
16
votes
6 answers

How to add gridview setOnItemClickListener

I have a GridView with 81 buttons on it. I want to add clicklistener to this gridview but it is not available. I have added the OnItemClickListener but it is not working and I cannot understand why. There is no error with the code. The only thing…
Batuhan Coşkun
  • 2,877
  • 2
  • 25
  • 46
16
votes
1 answer

how to run media scanner in android

I want run the media scanner while capturing the image. After capturing, the image it is updated in grid view. For that I need to run media scanner. I found two solutions to run media scanner one is the broadcast event and other one is running…
14
votes
1 answer

Android : Putting Grid of dynamic&custom objects inside another Grid of dynamic&custom objects

I am working on an Android project in which I am using the 'SuperSlim' framework for creating a grid view of Notes(Custom class) along with data to be displayed. Notes in the Database have a many-to-one relationship with Sections(Custom class). And…
We are Borg
  • 4,592
  • 13
  • 80
  • 184
14
votes
1 answer

Gridview onScroll method gets called always, without user scroll

I have a customized gridview where i'm checking onScroll method to find the end of the list. If the scroll reaches the end of the list, it will again add few elements in to the list. gridview.setOnScrollListener(new OnScrollListener() { …
hacker
  • 8,731
  • 12
  • 55
  • 106
14
votes
5 answers

GridView item list selector for multiple items not working in Android

I want to draw selector on long press as shown in the picture. When I do long press on one item, the CAB menu is activated. But the list selector indicator goes off once after clicking. I want that list selectors to be active till the CAB menu is…
14
votes
6 answers

Why items change order upon scrolling in Android GridView?

I have a GridView in android which I fill it with data retrieved from a xml resource. For example I have 15 items in the GridView which are placed in order. The overall height exceeds the Screen height so i have to scroll to see the rest of the…
2hamed
  • 7,739
  • 11
  • 60
  • 102
13
votes
4 answers

Android Hello GridView Tutorial Will Not Display Images

First time poster! I am new to Android development and have been following Google's HelloView tutorials without problems... until the HelloGridView tutorial. For some reason I cannot get any images to display, only a black background. I originally…
MarnBeast
  • 403
  • 4
  • 10
13
votes
2 answers

How can I create custom alert dialog with grid view in android?

How can I create a Alert Dialog with a GridView as shown in the image above?
Abhishek E H
  • 367
  • 2
  • 4
  • 12