I was wondering my code bellow is working very very well with android 2.2 and 3.2 but alway crash with android 4.x.
How to solve it for android latest version?
search_btn.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                EditText search_text = (EditText) findViewById(R.id.SearchBox);
                String search_txt_enter = search_text.getText().toString();
                if(search_txt_enter.equals(""))
                {
                    Toast.makeText(getBaseContext(),"All field are required",Toast.LENGTH_SHORT).show();
                }
                else
                {
                    try
                    {
                        HttpClient httpclient = new DefaultHttpClient();
                        HttpPost httppost = new HttpPost("http://mobile.xxxxx.com/search.php");
                        List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
                        nameValuePairs.add(new BasicNameValuePair("search", search_txt_enter.trim()));
                        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                        HttpResponse response = httpclient.execute(httppost);
                        InputStream inputStream = response.getEntity().getContent();
                        inputStream.close();
                    }
                    catch (ClientProtocolException e)
                    {
                     // TODO Auto-generated catch block
                    }
                    catch (IOException e)
                    {
                     // TODO Auto-generated catch block
                    }
                }
            }
        });
 
     
    