Page 586 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 586

Toast.makeText(this,  "비콘  서비스  시작",  Toast.LENGTH_SHORT).show();

                            }

                       else


                            {

                                 final Intent  intent = new Intent(this,  BeaconService.class);

                                 startActivity(intent);

                                            Toast.makeText(this,  "비콘  서비스  시작",  Toast.LENGTH_SHORT).show();

                            }


                 }

                 @Override

                 public  void onStart() {

                       super.onStart();

                       if (!mBluetoothAdapter.isEnabled())  {


                            Intent                 enableIntent                     =                    new
            Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);

                            startActivityForResult(enableIntent,  REQUEST_ENABLE_BT);

                       }  else {


                            if  (Beaconservicestart  ==  null)

                                 setupChat();

                  //  블루투스가  활성화  되었을때,  이미  서비스중이  아니면  서비스를  시작한다.

                       }

                 }


                    //  블루투스를  활성화  시킨다음...

                 public  void onActivityResult(int  requestCode, int resultCode,  Intent  data)  {

                       switch  (requestCode) {

                            case  REQUEST_CONNECT_DEVICE_SECURE:





                                                         -  579  -
   581   582   583   584   585   586   587   588   589   590   591