Note that there are some explanatory texts on larger screens.

plurals
  1. POhttppost.execute goes to exception
    text
    copied!<p>i have searched each and every thing at this site but still i don't understand what is matter with my code i have debugged it also it goes to exception when it tries to execute the this line "HttpResponse response=httpclient.execute(httppost)" i have also added permission of internet in android manifest file but still don't understand whats the matter.</p> <p>please help me i shall be very thankful to all of you.....</p> <p>here is my code</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // set a click listener on the alert button Button alert = (Button) findViewById(R.id.alertbtn); alert.setOnClickListener(this); } public void onClick(View view) { if (view == findViewById(R.id.alertbtn)) { AlertDialog.Builder alertbox = new AlertDialog.Builder(this); ArrayList&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;(2); postParameters.add(new BasicNameValuePair("email","awais")); postParameters.add(new BasicNameValuePair("password","123")); try { HttpClient httpclient=new DefaultHttpClient(); HttpPost httppost=new HttpPost("http://localhost/doctroidlogin.php"); httppost.setEntity(new UrlEncodedFormEntity(postParameters)); HttpResponse response=httpclient.execute(httppost); HttpEntity entity=response.getEntity(); if(entity.toString().length()&gt;0) alertbox.setMessage("Welcome to DangerZone!"); else alertbox.setMessage("Invalid Email or Password"); alertbox.show(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } </code></pre> <p>Log Cat</p> <pre><code>09-23 00:53:51.251: WARN/System.err(327): java.net.UnknownHostException: pannl.com 09-23 00:53:51.266: WARN/System.err(327): at java.net.InetAddress.lookupHostByName(InetAddress.java:506) 09-23 00:53:51.285: WARN/System.err(327): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294) 09-23 00:53:51.285: WARN/System.err(327): at java.net.InetAddress.getAllByName(InetAddress.java:256) 09-23 00:53:51.306: WARN/System.err(327): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136) 09-23 00:53:51.316: WARN/System.err(327): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) 09-23 00:53:51.336: WARN/System.err(327): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) 09-23 00:53:51.356: WARN/System.err(327): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359) 09-23 00:53:51.366: WARN/System.err(327): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) 09-23 00:53:51.375: WARN/System.err(327): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) 09-23 00:53:51.386: WARN/System.err(327): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) 09-23 00:53:51.406: WARN/System.err(327): at huuah.dialogboxes.LastActivity.onClick(LastActivity.java:57) 09-23 00:53:51.415: WARN/System.err(327): at android.view.View.performClick(View.java:2485) 09-23 00:53:51.436: WARN/System.err(327): at android.view.View$PerformClick.run(View.java:9080) 09-23 00:53:51.466: WARN/System.err(327): at android.os.Handler.handleCallback(Handler.java:587) 09-23 00:53:51.476: WARN/System.err(327): at android.os.Handler.dispatchMessage(Handler.java:92) 09-23 00:53:51.486: WARN/System.err(327): at android.os.Looper.loop(Looper.java:123) 09-23 00:53:51.506: WARN/System.err(327): at android.app.ActivityThread.main(ActivityThread.java:3683) 09-23 00:53:51.516: WARN/System.err(327): at java.lang.reflect.Method.invokeNative(Native Method) 09-23 00:53:51.526: WARN/System.err(327): at java.lang.reflect.Method.invoke(Method.java:507) 09-23 00:53:51.546: WARN/System.err(327): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 09-23 00:53:51.566: WARN/System.err(327): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 09-23 00:53:51.566: WARN/System.err(327): at dalvik.system.NativeStart.main(Native Method) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload