Hi i need your help please I am still learning android...i don't know this error "at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1133)"...
can you help me how to solve this.

Thank you.

You'll probably need to post your code for anyone to help you here.

public void onClick(View arg0){


       HttpClient httpclient = new DefaultHttpClient();
       nameValuePairs = new ArrayList<NameValuePair>(2);
       nameValuePairs.add(new BasicNameValuePair("username",username.getText().toString()));
       nameValuePairs.add(new BasicNameValuePair("password",password.getText().toString()));

       HttpPost  httppost = new HttpPost("");

       httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
       HttpResponse response = httpclient.execute(httppost);

   catch(IOException ex){

    Toast  toast = Toast.makeText(this, username.getText()+" "+password.getText(), Toast.LENGTH_SHORT);


Hi peter budo,Thank you for the reply...can i ask how did you know that i am performing in the UI thread...I do apologize i am still learning android.

Thank you so much Peter Budo it's working now

To respond to your previous question answer is simple. onClick() event have to be associated with listener that has to be attached to UI element that can only exist in View, Fragment or Activity