마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

string 데이터를 핸들러(handler)로 보내는 방법 질문이요..

0 추천

        public void run() {
            Log.i(TAG, "BEGIN mConnectedThread");
            byte[] buffer = new byte[1024];
            int bytes;


            // Keep listening to the InputStream while connected
            while (true) {
                try {
                    // Read from the InputStream

                	String mmm = "";
                   
                    while(mmm.length() < 28) {
                    bytes = mmInStream.read(buffer);
                    mmm = mmm.concat(new String(buffer,0,bytes));
                    	if(mmm.length() > 28) {
                    		String kkk = mmm;
                    		Log.d("kkkck", kkk);  
         		
                    	}
                    }
                    
         
                } catch (IOException e) {
                    Log.e(TAG, "disconnected", e);
                    connectionLost();
                    // Start the service over to restart listening mode
                    BluetoothChatService.this.start();
                    break;
                }
            }
        }

bluetoothchatservice.java 소스 일부입니다. 여기서 string kkk를 mainactivity.java로 보내서 textview로 출력해야합니다.

그런데 제가 왕초보라 handler를 어떻게 사용해야 할지 모르겠어요.. 제발 도와주세요..

익명사용자 님이 2014년 5월 25일 질문
핸들러에 대한 이해가 없으시다면 우선 책을 보심이...

1개의 답변

0 추천
해당 예제에 핸들러로 다른 클래스에 메세지 보내는 것이 있는 것으로 기억합니다...

소스코드를 다시 한번 보심이...
인연 (31,880 포인트) 님이 2014년 5월 28일 답변
...