|
18 | 18 | import Android.Zone.Http.MyConn_Utils.CallBack; |
19 | 19 | import Android.Zone.Http.MyConn_Utils.FileUpLoad_CallBack; |
20 | 20 | import Android.Zone.SD.FileUtils_SD; |
| 21 | +import android.annotation.SuppressLint; |
21 | 22 | import android.app.Activity; |
| 23 | +import android.app.IntentService; |
22 | 24 | import android.content.Intent; |
23 | 25 | import android.os.Bundle; |
| 26 | +import android.os.Handler; |
| 27 | +import android.os.HandlerThread; |
| 28 | +import android.os.Looper; |
| 29 | +import android.os.Message; |
24 | 30 | import android.util.Log; |
25 | 31 | import android.view.View; |
26 | 32 | import android.view.View.OnClickListener; |
27 | 33 | import android.widget.Button; |
28 | 34 |
|
29 | | -public class Http_MainActivity extends Activity implements OnClickListener{ |
| 35 | +public class Http_MainActivity extends Activity implements OnClickListener { |
30 | 36 | final String UrlPath = "http://192.168.1.102:8008/Test/log"; |
31 | 37 | Map<String,Object> map= new HashMap<String, Object>(); |
32 | 38 | Map<String, String> params = new HashMap<String, String>(); |
33 | 39 | @Override |
34 | 40 | protected void onCreate(Bundle savedInstanceState) { |
35 | 41 | super.onCreate(savedInstanceState); |
36 | 42 | setContentView(R.layout.a_http_test); |
| 43 | + //这段 只是学习下handler~ |
| 44 | + new Thread(){ |
| 45 | + @SuppressLint("NewApi") |
| 46 | + public void run() { |
| 47 | + Looper.prepare(); |
| 48 | + //Handler.Callback 还必须这么写 |
| 49 | + Handler abc=new Handler(new Handler.Callback() { |
| 50 | + |
| 51 | + @Override |
| 52 | + public boolean handleMessage(Message msg) { |
| 53 | + return false; |
| 54 | + } |
| 55 | + }); |
| 56 | + Looper.loop(); |
| 57 | + Looper.myLooper().quitSafely(); |
| 58 | + }; |
| 59 | + }.start(); |
| 60 | + |
37 | 61 | } |
38 | 62 | @Override |
39 | 63 | public void onClick(View v) { |
|
0 commit comments