java.net.SocketException: Permission denied for android

后端 未结 2 2051
温柔的废话
温柔的废话 2020-12-10 13:56

I create my android application to link \"www.google.com\" . But I always get the Exception like that:

07-20 16:50:31.137: W/System.err(19007): java.net.Sock         


        
相关标签:
2条回答
  • 2020-12-10 14:05

    UPDATE (from comments) You must add

    <uses-permission android:name="android.permission.INTERNET"/>
    

    To your manifest

    Original response

    add <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> this to your manifest and check.

    0 讨论(0)
  • 2020-12-10 14:10

    Plese check your class name because

    class name is

    public class HttpClientTest extends Activity {

    But your activity in Manifest.xml is

    android:name=".HttpClient"

    I think you essay change activity name is "HttpClientTest" . Because i'm test your code complete.

    0 讨论(0)
提交回复
热议问题