첫번째 질문입니다. MainActivity 안에서 shownotificaiton() 이라는 메소드를 만들어서
Vivrator mVivrator = (Vibrator) getSystemService(contextm.VIBRATOR_SERVICE);
라는 진동 서비스 객체를 만들었습니다. 근대 이부분에서 에러가 나더라구요
찾아보니까 이유는 CONTEXT라는데 어찌 해야할지 모르겠습니다. 저 shownotification()메소드는
다른 클래스에서 MainActivity 클래스 객체를 선언한후 그 객체 메소드를 통해서 접근합니다.
그러니까 구체적으로 Bluetooth.java 에서 thread() 함수를 이용하여 리시브가 발생하면 MainActivity.java 의
객체를 생성하여 그 객체를 이용하여 메소드에 접근하는 방식입니다.
로그 에러는 이렇게 뜹니다.
E/AndroidRuntime: FATAL EXCEPTION: Thread-7074
Process: com.example.lbm.smombee, PID: 8021
java.lang.IllegalStateException: System services not available to Activities before onCreate()