Browse - Programming Tips - How can I avoid a crash because of "Network activity on main thread"?
Q. How can I avoid a crash because of "Network activity on main thread"?
A. Of course you can make a thread and put the network stuff there.
But here's a trick. You can set the target version to 9
In the manifest.
And Android doesn't complain. Needless to say, its best not to make the user
wait for network activity but if its a test app or the like then its
no big deal.