Page 466 - MDP2020-3
P. 466

460
                      |    인천전자마이스터고등학교  ·············································································································

                            }
                    }



                    class  GetData  extends  AsyncTask<String,  Void,  String>  {
                            ProgressDialog  progressDialog;
                            @Override
                            protected  void  onPreExecute(){

                                    super.onPreExecute();
                                    progressDialog=ProgressDialog.show(Selectgame_on.this,"Please
            Wait",null,true,true);
                            }
                            @Override

                            protected  void  onPostExecute(String  result){
                                    super.onPostExecute(result);
                                    progressDialog.dismiss();


                                    final  Variable  variable2  =  (Variable)  getApplication();

                                    variable2.setMode(result);


                                    Intent  intent  =  new  Intent(getApplicationContext(),Playgame_on.class);
                                    startActivity(intent);
                                    finish();

                            }
                            @Override
                            protected  String  doInBackground(String...  params){
                                    try  {
                                            String  serverURL="http://192.168.102.83/MDP/R_T_mode.php";

                                            URL  url  =  new  URL(serverURL);
                                            HttpURLConnection    httpURLConnection=(HttpURLConnection)
            url.openConnection();
                                            httpURLConnection.setReadTimeout(5000);
                                            httpURLConnection.setConnectTimeout(5000);

                                            httpURLConnection.connect();
                                            int  responeStatusCode  =  httpURLConnection.getResponseCode();
                                            InputStream  inputStream;


                                            if  (responeStatusCode  ==  HttpURLConnection.HTTP_OK)  {

                                                    inputStream  =  httpURLConnection.getInputStream();
                                            }  else  {
                                                    inputStream  =  httpURLConnection.getErrorStream();
                                            }
   461   462   463   464   465   466   467   468   469   470   471