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

BluetoothChat - Notification

0 추천
BluetoothChat 샘플 코드에다가 Notification 기능과 연동할려구하는데요

 

------------------------------------------------------------------------------------------

mNoti = new NotificationCompat.Builder(getApplicationContext())
    .setContentTitle("아이 상태를 확인하세요!!!")
    .setContentText("화면 항상 켜기가 실행 중입니다!")
    .setSmallIcon(R.drawable.ic_launcher)
    .setTicker("알림!!!")
    .setAutoCancel(true)
    .setContentIntent(mPendingIntent)
    .build();

---------------------------------------------------------------------------------------------

이부분이 BluetoothChat 수신부 입니다

case MESSAGE_READ:
                byte[] readBuf = (byte[]) msg.obj;
                // construct a string from the valid bytes in the buffer
                String readMessage = new String(readBuf, 0, msg.arg1);
                mConversationArrayAdapter.add(mConnectedDeviceName+":  " + readMessage);
                //메세지 수신시 진동구현
                Vibrator vibrator = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
                long milliseconds = 1000;
                vibrator.vibrate(milliseconds);
                break;

---------------------------------------------------------------------------------------

여기가 Notification 부분인데요 setContentText("화면 항상 켜기가 실행 중입니다!") 이부분에서 BluetoothChat 의 수신메세지를 띄울려고하는데 어떻게해야할지 모르겠네요 도와주세요`
sn1883 (860 포인트) 님이 2014년 5월 21일 질문
sn1883님이 2014년 5월 21일 수정

1개의 답변

+1 추천
쎄미 (162,410 포인트) 님이 2014년 5월 21일 답변
...