Android Wear: built-in notification activity is not running in the emulator

I have a custom layout notification that runs from a wearable, that is, only visible on the watch. Nested activity works successfully on a real device, but it does not start on emulators. When you pick up a map to show a custom notification, I just get a black box on the map. A notification is sent from startup activity.

It starts in the usual way on the wearable side:

// Build context stream notification Intent notificationIntent = new Intent( this, NotificationActivity.class ); PendingIntent pendingNotificationIntent = PendingIntent.getActivity( this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT ); Notification.Builder builder = new Notification.Builder( this ) .setSmallIcon( R.drawable.ic_launcher ) .setContentTitle( getString( R.string.app_name ) ) .extend( new Notification.WearableExtender() .setDisplayIntent( pendingNotificationIntent ) ); NotificationManager notificationManager = (NotificationManager) getSystemService( NOTIFICATION_SERVICE ); notificationManager.notify( 0, builder.build() ); 

Has anyone seen something like this? I'm just wondering if this is a problem only for the emulator or more common for real devices, since I only have one device for testing (Samsung Gear Live), which works fine.

+5
source share

Source: https://habr.com/ru/post/1202523/


All Articles