It's literally impossible.
You can't stop someone from capturing packets once they're handed over from the Android system to the next hop in the network. If you somehow manage to prohibit someone from capturing on the phone, they can still capture on their wifi.
Furthermore, trying to stop it on the phone is just silly. Any determined attacker will spend three minutes setting up a capture on their wifi.
It's simply a function of how TCP/IP works.
Trying to prevent using the Wi-Fi isn't going to prevent someone else somewhere on the network from capturing or inspecting it. Making users' lives difficult for this reason is security theatre and will only serve to waste people's time and irritate people. You always have to assume the network is untrusted and that everybody can see and intercept your packets.
From comment by bk2204.
This is universally true. What ever you are trying to achieve, you're doing it the wrong way.