Languages

Menu
Sites
Language
How to auto close RichNotification (in Samsung Accessory Library)?

안녕하십니까? 
Hello?

 

삼성 Accessory  라이브러리에서 지원하는 RichNotification 을 사용해서 안드로이드 폰에서 기어S2 로 Notification 을 보냈습니다.
I used RichNotification in Samung Accessory Library, to send Noti from Android phone to GearS2.

 

그리고 Noti 에서 아이콘을 선택하면 기어S2 에 설치된 Tizen 앱이 실행되도록 하였습니다.
When touch icon in notification, sample Tizen app is running in GearS2.

 

그런데 앱이 실행된 이후에 Noti 는 사라지지 않고 그대로 남아있습니다.
But the notification does not disappear, after sample app is loaded.

 

Noti 의 아이콘을 선택했을때 Noti 가 사라지도록 하는 방법을 알려주십시요.
How to auto close RichNotification, when touch icon in notification?

 

아래는 제가 작성한 안드로이드 코드 입니다.
Below is Android phone's source code.

 

==============================================================
        mRichNotificationManager = new SrnRichNotificationManager(getApplicationContext());
        mRichNotificationManager.start();

        SrnRichNotification myRichNotification = new SrnRichNotification(this);
        Bitmap myAppIconBitmap = BitmapFactory.decodeResource(getResources(),
                R.mipmap.ic_launcher);
        SrnImageAsset myAppIcon = new SrnImageAsset(this, "app_icon", myAppIconBitmap);
        myRichNotification.setIcon(myAppIcon);
        myRichNotification.setTitle("Raptors vs. Nets");

        SrnStandardTemplate myPrimaryTemplate = new SrnStandardTemplate(SrnStandardTemplate.HeaderSizeType.MEDIUM);
        myRichNotification.setPrimaryTemplate(myPrimaryTemplate);

        SrnRemoteLaunchAction myAction = new SrnRemoteLaunchAction("Check In");
        Bitmap checkInIconBitmap = BitmapFactory.decodeResource(getResources(),
                R.drawable.listen);
        SrnImageAsset checkInIcon = new SrnImageAsset(this, "checkin_icon", checkInIconBitmap);
        myAction.setIcon(checkInIcon);

        myAction.setPackage("org.example.multiview");
        Bundle bundle = new Bundle();
        bundle.putString("message","data from phone");
        myAction.setExtras(bundle);

        myRichNotification.addActionWithPermissionCheck(myAction);
        myRichNotification.setAlertType(SrnRichNotification.AlertType.SOUND_AND_VIBRATION, SrnRichNotification.PopupType.NORMAL);
        mRichNotificationManager.notify(myRichNotification);
        mRichNotificationManager.stop();

Edited by: Dong-Geun Jung on 22 Jun, 2016

Responses

4 Replies
Yasin Ali

Hi~,

You have to dismiss active rich notifications to close RichNotification.
From your code:
....

mRichNotificationManager.notify(myRichNotification);
//Notifies the rich notification service about a new/updated rich notification

mRichNotificationManager.stop();
//Stops the Rich Notification Manager not the active rich notifications

Add dismissAll();
before  mRichNotificationManager.stop();

dismissAll() dismisses all active rich notifications.

If this resolves your issue make it best answer so that other people
can get exact help easily.

Dong-Geun Jung

Sorry I tryed and failed.

I modifyed my codes as below, but noti does not sented to GearS2.

        mRichNotificationManager.notify(myRichNotification);
        mRichNotificationManager.dismissAll();
        mRichNotificationManager.stop();

 

I want noti auto disappear when user touches the Icon of RichNotification. => ( SrnRemoteLaunchAction myAction )

Please show me sample codes.

 

Dong-Geun Jung

Below is my sample source project.

Install android phone app and tizen wearable app to each device.
(Android phone and GearS2 must be peared by bluetooth.)

Run android app, and press button. Then noti will be shown in GearS2.

If you touch Icon in noti, sample app in GearS2 will be running.

I want to close noti, when user touches the Icon in noti.

 

Please modify this source, and send back to me.

My Email address is topofsan@naver.com

 

1. MultiView.zip : Tizen receiver source project.

 - Download Url Link : http://naver.me/xMiWAqBt

2. RichNotiSender.zip : Android sender source project

 - Download Url Link : http://naver.me/xbhf9VDR

 

Thank you!

Hyojin Kwon

제가 현재 진행중인 프로젝트랑 정말 비슷하네요 ㅠㅠ

혹시 rich notification 어떻게 사용하는 건지 알려주실 수 있을까요????