Recently there was a post with a case of android.os.NetworkOnMainThreadException
. In search of a fitting original for this almost certainly duplicate, I followed a link provided below this post and found Caused by: android.os.NetworkOnMainThreadException [duplicate].
The first strange thing about this eight year old question is that the is no link to an original post although it was closed as duplicate:
So this was not really a candidate for closing the current post as duplicate, but all well there since someone else had provided one in the mean time:
How to fix 'android.os.NetworkOnMainThreadException'?
Back to my orphaned duplicate: maybe it should be merged/ linked to the valid original? Closer inspection of the accepted answer showed that there would be no value added - it mentions something which is considered very bad practice in android development as one of two equally valid options.
By the way, the asker of the recent question was happy with the hacky "solution" to their problem, so although the problem answer is old, it is still doing harm.
In my opinion the entire post should best be deleted: the android.os.NetworkOnMainThreadException
was introduced because waiting for a response from a network call on the UI thread may cause the UI to freeze, which is not acceptable to many users (and some app stores). So bypassing this rule is likely to cause issues later on.
I've noticed there is a delete Button, but I'm not sure whether it's possible to have a question deleted which has an accepted answer with 121 upvotes. And my downvote.
So what should be done with this post?