-
Android HTTP Post连接服务器超时示例
资源介绍
new Thread(new Runnable() {
public void run() {
// TODO Auto-generated method stub
try {
//设置连接超时
HttpParams httpParameters = new BasicHttpParams();
int timeoutConnection = 3000;
HttpConnectionParams.setConnectionTimeout(httpParameters,
timeoutConnection);
DefaultHttpClient httpclient = new DefaultHttpClient(
httpParameters);