The solution is don't commit crimes, don't use your race as an excuse to commit crimes, and don't resist arrest. Boom, then you aren't very likely to get shot by a cop.
We also need to stop making immediate saints out of people with rap sheets half a mile long. Doesn't mean they deserved to die, but it doesn't mean you don't acknowledge their criminal lifestyle lead to this outcome.
We all want to talk about better training for police officers, etc. as if they are the only people in this that need to change. They are not.
At this point it's like the black community is just super confused because there is no method to this madness. When Mike Brown was killed by a cop they..didn't riot and go after white cops, they burned buildings and looted businesses..mostly black owned businesses. Then just like in Dallas..not even all the cops shot were white. Yet this was supposedly about white police brutality but they kill black and hispanic cops too.