title: How can I manage gridview according to widht of items in android
body: <p>I have to manage gridview as below. Please sugges how can I manage gridview as it is image.</p>
  
  <p><img src="https://i.stack.imgur.com/0uKS1.jpg" alt="enter image description here"></p>
  
  <p>I am using following xml code</p>
  
  <pre><code> &lt;GridView
              android:id="@+id/tags_dialog_list"
              android:layout_width="match_parent"
              android:layout_height="@dimen/dialog_internal_list_height"
              android:layout_marginTop="2dp"
              android:choiceMode="singleChoice"
              android:horizontalSpacing="@dimen/tags_grid_item_divider_size"
              android:numColumns="auto_fit"
              android:layout_marginLeft="@dimen/tags_grid_item_divider_size"
  
              android:verticalSpacing="@dimen/tags_grid_item_divider_size" /&gt;
  </code></pre>