Getting null response from server in android application
===

i need to post a server -id to the server via http post.Flow is -->As soon as i press the "email button",the server id needs to be posted to the server.Iam displaying a dialog box ,on pressing the dialog button the server id is posted.However iam geeting a null reponse.The server id is getting populated in the namevaluepair list.But still showing null response...Thnx in advance.










       else if(v == btn_emailform){
    			Log.v("click email", "click email");
    			if(!DBHandler.checkInternet(this)){
    				Toast.makeText(this, DBHandler.INTERNET_DISCONNECTED_MESSAGE,Toast.LENGTH_LONG).show();
    				return;
    			}
    			
    			final AlertDialog.Builder dialogBuilder;
    			dialogBuilder = new AlertDialog.Builder(this);
    			dialogBuilder.setMessage("Email sent successfully");
    			dialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
    
    				public void onClick(DialogInterface dialog, int which) {
    					emailDialog.cancel();
    					sendemail();
    				  finish();
    				}
    
    				private void sendemail() {
    					
    					
    			
    						Thread background = new Thread() {
    							
    
    			        		public void run() {
    			        			
    			        			try {
    			        			
    			        					                    
    			                    HttpPost post = new HttpPost("http://xyz/Send_Invoice_Attachment");
    			                    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
    			                   
    			                    nameValuePairs.add(new BasicNameValuePair("id",edittext_serverid.getText().toString()));
    			                    Log.v("namevaluepair",nameValuePairs.toString());
    			                  //  nameValuePairs.add(new BasicNameValuePair("postValue2", "2nd Value"));
    			                    post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"UTF-8"));
    
    			                    HttpClient client = new DefaultHttpClient();
    			                    HttpResponse response = client.execute(post);
    			                    HttpEntity entity = response.getEntity();
    			                    String responseText = EntityUtils.toString(entity);
    			                    Log.v("response", responseText);
    			        			
    			        			
    			        		} catch (Exception e) {
    			        			
    			        			e.printStackTrace();
    			        			
    						return;
    						//handler.sendEmptyMessage(0);
    						
    			        			
    			        		} 	
    
    
    			        			
    
    							}// end of run
    						};// end of new Thread
    
    						background.start();
    					
    				}
    			});
    			
    			
    			
    
    			emailDialog = dialogBuilder.create();
    			emailDialog.setCancelable(false);
    			emailDialog.show();
    			}
    			
    			
    		
    			
    		}
    	
    
    	
    	

