Page 133 - MDP2022-2
P. 133

while((line  =  bufferedReader.readLine())  !=  null)  {
                                                    sb.append(line);
                                            }


                                            bufferedReader.close();
                                            return  sb.toString().trim();
                                    }
                                    catch  (Exception  e)  {
                                            Log.d(TAG,  "InsertData:  Error  ",  e);
                                            errorString  =  e.toString();
                                            return  null;
                                    }
                            }
                            @Override
                            protected  void  onPostExecute(String  result)  {
                                    super.onPostExecute(result);
                                    progressDialog.dismiss();


                                    if(result.equals("again"))  {
                                            lock.setImageResource(R.drawable.padlock);
                                            lock_cnt=0;
                                            infor.GetData  task  =  new  infor.GetData();
                                            task.execute(String.valueOf(temperature_want),  "10",ID);
                                    }
                                    else  if(result.equals("logout"))  {
                                            Intent  intent2  =  new  Intent(infor.this  ,popup.class);
                                            intent2.putExtra("data","로그아웃  되었습니다.");
                                            startActivityForResult(intent2,  1);
                                            finish();
                                    }  else  {
                                            if  (result.isEmpty())  {}
                                            else
                                            {
                                                    String[]  infor  =  result.split(",");
                                                    real_temp.setText(infor[1]);
                                                    real_moisture.setText(infor[2]);
                                            }
                                    }
                            }
                    }
            }
            제어화면(xml)
            <?xml  version="1.0"  encoding="utf-8"?>
            <LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
                    xmlns:app="http://schemas.android.com/apk/res-auto"
   128   129   130   131   132   133   134   135   136   137   138