0
웨어러블에 사용자 지정 작업을 포함시켜야하는 두 번째 페이지로 웨어러블 호환 알림을 만듭니다. 여기 웨어러블 알림 페이지에 디스플레이 인 텐트 사용
<activity android:name=".Test"
android:label="aaa"
android:allowEmbedded="true"
android:taskAffinity=""
android:theme="@android:style/Theme.DeviceDefault.Light">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
전화에서 내 관련 안드로이드 코드 : 여기
는 착용 할 수있는 응용 프로그램에서 매니페스트의 관련 부분입니다
Intent notificationIntent = new Intent();
notificationIntent.setClassName(BuildConfig.APPLICATION_ID, BuildConfig.APPLICATION_ID + ".wear.Main");
PendingIntent notificationPendingIntent = PendingIntent.getActivity(this, 0,
notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
Bitmap bg = BitmapFactory.decodeResource(getResources(), R.drawable.bg_wearable);
Notification test = new NotificationCompat.Builder(this)
.setAutoCancel(true)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("Title")
.setContentText("Message")
.extend(new NotificationCompat.WearableExtender()
.setBackground(bg)
.addPage(new NotificationCompat.Builder(this)
.setContentTitle("Page 1")
.extend(new NotificationCompat.WearableExtender()
.setDisplayIntent(notificationPendingIntent)
.setCustomSizePreset(NotificationCompat.WearableExtender.SIZE_FULL_SCREEN)
).build()
)
)
.build();
NotificationManagerCompat.from(this).notify(12345, test);
당신이 어떤 생각을 가지고 있습니까 왜 돈 ' 휴대 전화에서는 작동하지만 웨어러블 기기에서는 작동하지 않습니까?
나쁘지 :(RTFM의 경우. 지적 해 주셔서 감사합니다. – rekire