Artificial gravity is extremely reliable in Star Trek and apparently doesn't require much power, so it would be a good way to keep commbadges attached.
As long as you don't attach it too close to the nipple...
Wasn't there an episode where someone took off their combadge and a small white square was left behind? (a prop thing I think)
How about magnetic-micro-velcro? Good for everything but plastic and wood!