The reason why there is a lot of space between the columns of gridview is that the textview in your layout is not occupying the complete column space provided by the grid view
To avoid this problem , you have to calculate the device's screen width and height and divide it by number of columns and rows respectively. This will give you the exact width and height you needed for your single textview.Set this as the dimensions of your text view. You will get equal space between your rows and columns
The code will be as follows
DisplayMetrics displayMetrics=getResources().getDisplayMetrics();
screen_width=displayMetrics.widthPixels; //width of the device screen
screen_height=displayMetrics.heightPixels; //height of device screen
int view_width=screen_width/columns; //width for text view
int view_height=screen_height/rows; //height for text view
textview.getgetLayoutParams().width=view_width;
textview.getgetLayoutParams().height=view_height;