Green’s Dictionary of Slang

flagging n.2

(US gay) wearing a handkerchief, in a back trouser pocket, to indicate a sexual preference.

[US]R. Scott Rebecca’s Dict. of Queer Sl. 🌐 flagging — to wear a hanky to show what kind of sexual activity one is interested in.

In phrases

flaggin’, saggin’ and braggin’ [such activities are often spec. prohibited in prisons in the (vain) hope of minimizing inter-gang tensions]

(US black gang) a phr. describing the means of identifying oneself as a member of a gang, esp. in prison; spec. wearing the gang colours, wearing one’s trousers low on the hips and boasting about one’s exploits in the free world.

[US]L. Bing Do or Die (1992) 243: Flaggin’. Saggin’. Braggin’. Lettin’ people know you’re part of something that is powerful.
Bone Thugs-N-Harmony ‘Murder One’ 🎵 BTNHResurrection [album] It’s always that one lil’ nigga, saggin’ and braggin’ and talkin’ loud.