:wa:
One day when me and my friend visited a place we saw a donation box from an orphanage. Then I put money in that donation box, just small amount, and I told my friend "We have to care to the orphans". So my friend donated his money too.
Was I doing riya?. I didn't think so. I just wanted to remind him and did not intend to be praised by him. Riya is doing an amal or good deed with intention to make people praise the person who do this amal. Riya or not riya is depend on intention.
If you invite the others to do an amal like invite them to perform salah sunnah in jama'at with you, it's not riya. If you feel motivated to do an amal because you see someone do this amal, it's not riya.
What is riya?. If you donated money and you tell everyone that you have donated your money to make them admire you, it's riya. If you do an amal like someone has done with intention to make the others know you can do this amal better than this person, it's riya.