1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Handler handler = new Handler() {
    @Override
    public void handleMessage(Message msg) {
        try {
            if (msg != null) {
 
                if(mAsyncThread.getResult() != null) {
 
                    JSONArray array = new JSONArray(mAsyncThread.getResult());
 
                    for (int i = 0; i < array.length(); i++) {
                        JSONObject obj = array.getJSONObject(i);
 
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            mAsyncThread = null;
            super.handleMessage(msg);
        }
    }
};
 
HashMap<String,String> hashMap = new HashMap<>();
hashMap.put("LAT""");
String param = "";
try {
    param = URLMaker.hashToUrl(hashMap);
}catch (Exception e){
    e.printStackTrace();
}
mAsyncThread = new AsyncThread(getActivity(), handler, "/get_hp/?" + param);
mAsyncThread.execute();
cs

+ Recent posts