我想发送包含电子邮件和姓名等视频和数据的多部分表单.以下是我的代码,它不起作用,没有来自服务器的响应
File file =new File(VideoPath);
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("Name", "LDGHT"));
nameValuePairs.add(new BasicNameValuePair("Email", "hhh@example.com"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
httppost.setEntity(new FileEntity(file, "video/mp4"));
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
} catch (IOException e) {
// TODO Auto-generated catch block
}
Run Code Online (Sandbox Code Playgroud) 我有四个edittexts问题是当我开始活动时焦点将放在最后一个edittext上,如何使用xml将焦点放在第一个edittext上?谢谢
如何在代码中找到android中当前键盘的语言.以及如何在代码中设置键盘的语言.例如,如果用户选择中文,则应显示中文键盘,如果选择英文,则应显示英文键盘.