My application is something that is having some categories, I am showing these categories in a grid view,I was successful in doing that.However later, I felt that I have a need to show notifications for each of the categories like the following:

![enter image description here](https://i.stack.imgur.com/PaCI9.png)

I was thinking that I will have to take a hidden view component for the notification count for each category, that I will need to show up only whenever there is a notification received regarding that category.But the thing is that it may happen that I may be receiving notifications of various categories simultaneously and hence I will need to call `notifyDataSetChanged()`,(dont know my approach is right or not) each time to show up the notification count.(which may be a costlier process) 

I want to know that how can I implement this gridview with notifications functionality efficiently, What if I want that the notification pops up with some animation, like the second bubble in the image,(and how to do that).

Framelayout in GridView seems to be the solution but it will be best if some example similar to that is shown to me.

I am also unsure about the approach I am thinking of.Is it a valid approach or some alternatives are there.

Here is my GridView:

```
<GridView  xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gridview" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:paddingLeft="7dp"
    android:paddingRight="7dp"
    android:layout_marginTop="5dp"
    android:verticalSpacing="2dp" 
    android:horizontalSpacing="2dp"
    android:scrollingCache="true" 
    android:smoothScrollbar="true"
    android:clipChildren="true" 
    android:alwaysDrawnWithCache="true"
    android:numColumns="auto_fit" 
    android:columnWidth="100dp"
    android:stretchMode="columnWidth" 
    android:gravity="center"
    android:background="#000000">
</GridView>

```

The Adapter class:

```
class ImageAdapterTabView extends BaseAdapter {

   private Context context;
   ArrayList<String> imageList = new ArrayList<String>();

   public ImageAdapterTabView(Context c) {
       context = c; 
   }

   void add(String path){
       imageList.add(path); 
   }

   @Override
   public int getCount() {
       return imageList.size();
   }

   @Override
   public Object getItem(int arg0) {
       // TODO Auto-generated method stub
       return arg0;
   }

   @Override
   public long getItemId(int position) {
       // TODO Auto-generated method stub
       return 0;
   }

   @Override
   public View getView(int position, View convertView, ViewGroup parent) {
       ImageView imageView;
       if (convertView == null) {  
           imageView = new ImageView(context);
           imageView.setLayoutParams(new GridView.LayoutParams(350, 350));
           imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
           imageView.setAdjustViewBounds(true);
        //   imageView.setPadding(5, 5, 5, 5);
       } else {
           imageView = (ImageView) convertView;
       }

       Bitmap bm = decodeSampledBitmapFromUri(imageList.get(position), 100, 100);
       imageView.setImageBitmap(bm);
       return imageView;
   }

   public Bitmap decodeSampledBitmapFromUri(String path, int reqWidth, int reqHeight) {

       Bitmap bm = null;
       final BitmapFactory.Options options = new BitmapFactory.Options();
       options.inJustDecodeBounds = true;
       BitmapFactory.decodeFile(path, options);
       options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);

       options.inJustDecodeBounds = false;
       bm = BitmapFactory.decodeFile(path, options); 

       return bm;   
   }

   public int calculateInSampleSize(

       BitmapFactory.Options options, int reqWidth, int reqHeight) {
       final int height = options.outHeight;
       final int width = options.outWidth;
       int inSampleSize = 1;

       if (height > reqHeight || width > reqWidth) {
           if (width > height) {
               inSampleSize = Math.round((float)height / (float)reqHeight);    
           } else {
               inSampleSize = Math.round((float)width / (float)reqWidth);    
           }   
       }

       return inSampleSize;    
   }

}

```