Why does the count of the Menu badge not decrease after page is viewed? I have created a view, which shows activity logged by Message module. 

I then created a menu badge which shows the numbers on the menu item. - In start, when there is no activity, it shows 0, After there is some activity it shows the count, but when the page is viewed the count remains the same and does not decrease or disappear. 

When the whole activity page is viewed, the numbers should disappear.
Part 1 - It does seem to work as designed

Since your question is about a "Menu badge", I'm assuming you are using the (great!) Menu Badges module to create such badge, whereas you also created a view (using the Views module).

To make it all work, your view should show the number of rows corresponding to the "activity logged by the Message module" (as in your question).

And the view seems to be OK if there is no activity (it shows "O").
However, if the count remains the same later on, then it must be because the result of your view doesn't change either. If you want that number produced by the Menu Badges module to change, then you must make sure that the view produces the correct number. So if that number doesn't change, it is about sure (not just probably ...) because something in the filter of your view is not correct. Like does your view only select the rows which have some kind of "new activity" indicator? If not, what other filter do you have to make that number decrease?

So IMO this is not a bug in the module, but rather just a customization error in your view (head over to Part 2 for more details on that).

Part 2 - What you're missing in your view

I think Part 1 of my answer is "the" answer to your question, but here is an attempt to also, partially, answer your additional comment (which is really a new question I think):


  If there is new activity, the number does increase, but do not decrease or disappear as in case of private messages. What I have understood so far of menu badges is that you have to put something in the fields section and turn on aggregation so that it knows what to count. Currently I am using Message:Message ID in the field. What filter I should use?


Not sure where the "private messages" refers to (I'm just going to consider that as "a" type of messages). But you're right about that "you have to put something in the fields section and turn on aggregation so that it knows what to count": that is the "clue" about what the Menu Badges is all about. Let's consider the Message View (where the below screenprints originate from) that comes with the Message module, i.e.:



Here is a screenprint with the design details of that view:



If you'd use the Add button for "fields", and then filter the available fields for "Message:", you would only get these fields:


Language
Message ID
Render message (Get text)
Rendered Message
Timestamp
Type
User uid


Obviously, none of these fields contain any information if it is yes or no a "new" message. So that's what you're missing and why out-of-the(-message)-box you cannot get this to work. To better explain this (what you're missing): have a look at the "tracker" view (disabled by default), which has the fields "Content:Has new content" and  "Content:Has new comments". Those are 2 perfect fields to use if you want to use Menu Badges to get notified whenever there is new content, or new comments.

A possible compromise, and maybe partial solution for your scenario could be that you'd use the Timestamp field as your filter. E.g. if you'd filter it like "only the ones from the last 24 hours", that should have some effect.

Part 3 - How to get it to work anyway

There is a way to get this to work anyway ... Because messages are fieldable. So simply (hm, hm) add a boolean field like "Message is new" (Yes/No). It'll then also show up in the list of fields you can select from in your view (in the list of available fields as in Part 2). And with that you have a perfect solution for what you're trying to get to work.

However, there is one more challenge left: add appropriate logic to maintain the value of that boolean field. If you wonder how to do that (also), just ask a new question.