In Lotus Notes and Domino 8.0 a new Java method was added to the view class: createViewNavFromAllUnread(). I spend quite some time to figure out that it is not working.
It seams that this method is broken since version 8.5 and is still broken in 9.0.
IBM is aware of the situation but there is no priority to fixing this issue.
One workaround is to use the method getAllUnreadEntries() from the view class. But this method is much slower than a ViewNavigator.
In my XPages project I was lucky. I only needed the number of unread mails from the users inbox. So I could use a feature from iNotes.
http://[path to users mail database]/iNotes/Proxy/?OpenDocument&Form=s_ReadViewEntries&PresetFields=FolderName;($Inbox),UnreadCountInfo;1,noPI;1&TZType=UTC&Start=1&Count=1
The URL returns a XML file with an entry unreadinfo.
<unreadinfo> <foldername>($Inbox)</foldername> <unreadcount>7</unreadcount> </unreadinfo>