Online activities can definitely help you in coping with loneliness provided that you carefully choose your activities. For instance, if you intend to dedicate most of your time to social media such as Facebook, you need to avoid contents that may trigger loneliness. You then may opt to reading blogs that interests you or watch funny videos.
Based on experience, I try to distract myself by browsing the internet about the new things I intend to learn such as new techniques in art, sketching, paper folding, photoshop, best places to travel or movies to watch. Online games are also a great way to deal with loneliness. You may choose whatever you think fits you.
I have a one living grandmother and she is 73 years old. She likes talking about her past experiences especially comparing the new generation with hers. She tends to be more philosophical most of the time. We do talk a lot about life, death, culture, norms, etc. She also likes hearing about stories about my experiences. I think it does not matter much about what interests them, for elderly people, the most important thing is communicating with them regularly or visiting them whenever you have the time.