Page 881 - 3-3
P. 881

InputStreamReader(con.getInputStream()));
                                   String json;
                                   while ((json = bufferedReader.readLine()) != null) { //  문자열을 받아옴
                                       sb.append(json + "\n");
                                   }
                                   return sb.toString().trim(); //  공백 제거
                               } catch (Exception e) {
                                   return null;
                               }
                           }
                           @Override
                           protected void onPostExecute(String result) {
                               //  결과값을 출력함
                               try {
                                   myJSON4 = result;
                                   showList4();
                               } catch (Exception e) { //  통신에 문제가 생길경우 예외처리
                                   Toast.makeText(getBaseContext(),          " 데이터         베이스          오류",
               Toast.LENGTH_SHORT).show();
                               }
                           }
                       }
                       GetDataJSON g = new GetDataJSON();
                       g.execute(url);
                   }
                   @Override
                   public boolean onOptionsItemSelected(MenuItem item) {
                       int id = item.getItemId();
                       if (id == android.R.id.home) { //  홈 버튼을 누를경우
                           finish(); // Activity  종료
                           return true;
                       }
                       return super.onOptionsItemSelected(item);
                   }
               }


                  <Web.java> (  홈페이지 )


               package com.helloworld.smartschool; //  패키지를 불러옴
               import android.content.Intent; //  화면 전환을 위해 인탠트를 불러옴
               import android.support.v7.app.AppCompatActivity; //  액티비티를 불러옴
               import android.os.Bundle; //  번들을 불러옴
               import android.view.MenuItem; //  홈 화면을 위해 불러옴
               import android.webkit.WebView; //  웹뷰를 불러옴
               import android.webkit.WebViewClient; //  웹뷰클라이언트를 불러옴


                                                          - 881 -
   876   877   878   879   880   881   882   883   884   885   886