Skip to content Skip to sidebar Skip to footer

Read Text File From Server In Android App

Possible Duplicate: android.os.NetworkOnMainThreadException I want to open a text file (one line with a few words) from a server in a TextView, but my current code crashes the a

Solution 1:

You're probably getting a NetworkOnMainThreadException. Android will not allow you to make network calls on the main/UI thread (ie directly in your Activity). You should use a separate thread, see this question for an example.


Post a Comment for "Read Text File From Server In Android App"