One of the men had posted a picture of both men together in bed on the social media site
In the photos the two men, aged 22 and 24, were kissing while shirtless, with a message that read: “With my dear lover tonight. May our love last for ever”.
Local police released a statement confirming that they had responded to “LGBT pornography in the form of two men canoodling.”
“The two men admitted they were the people in the photos,’’ police said.
They could face up to seven years imprisonment if found guilty of posting lewd materials online.
Indonesia, the world’s most populous Muslim-majority country, has seen growing hostilities against sexual minorities.
The government has sought to block gay-friendly mobile applications in Google and Apple app stores that it said promote “sexual deviance.”
It had also requested social networking services such as Line and Twitter to remove emoticons depicting same-sex couples for the Indonesian market.
Anti-gay sentiment began rising earlier this year after Higher Education Minister, Muhammad Nasir, warned of pro-LGBT activities on university campuses and banned such groups.
It said that since then, officials and conservative religious groups had made statements denouncing pro-LGBT activities.