用模拟器测试没有问题,在真机2.3平台上会爆异常

java.net.ProtocolException:Does not support output

但是在4.0平台上没有问题。

分析代码发现,需要设置

 conn.setDoOutput(true);