My boyfriend sees my Viber status changing from online to offline, while I don't even open it. He thinks I talk to someone but I don't use it. I have a Galaxy Note 7, he is using iPhone 6.
Viber is running in the background, so it can be still online if it wants. Because it's tracking your activity on your phone, it knows when your phone sleeps (the phone makes no activity in the foreground, in other words, your screen is black (off).
But, when you are using your phone to check your emails or to call someone, Viber knows that your phone is not sleeping and makes actions in the foreground, so Viber shows you online, because it's thinking you are ready to chat, and it's same when you get notification from another application (your phone wakes up and makes notification on foreground, you can see it, when your screen turns on).