New Text Document
New Text Document
try {
List<NameValuePair> nameValuePairs = new
ArrayList<NameValuePair>(2);
//nameValuePairs.add(new BasicNameValuePair("id", "01"));
nameValuePairs.add(new BasicNameValuePair("description",
des));
nameValuePairs.add(new BasicNameValuePair("category",
category.getSelectedItem().toString()));
nameValuePairs.add(new BasicNameValuePair("media",
attachment.toString()));
httppost.setEntity(new
UrlEncodedFormEntity(nameValuePairs));
httpclient.execute(httppost);
//description.setText(""); //reset the message text field
Toast.makeText(getBaseContext(),"Sent message to
server",Toast.LENGTH_SHORT).show();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} else {
//display message if text field is empty
Toast.makeText(getBaseContext(),"All fields are
required",Toast.LENGTH_SHORT).show();
}
}