2014-07-14 81 views
1

我已经创建了Android穿戴通知。通知正常出来。我还为通知添加了addAction。我有两个问题:Android穿戴通知

  1. 我不知道为什么我收到了三滑页(在底部的三个点),

    a. Notificaiton text 
    b. A black background image (second slide) 
    c. Add action button (third slide) 
    
  2. 我想上的通知点击打开新意图它不工作:

这是我曾尝试代码:

Intent notificationIntent = new Intent(this, Wear.class); 
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); 
int notificationId = 001; 
Bitmap background = BitmapFactory.decodeResource(getResources(), R.drawable.backgroundwatch); 
NotificationCompat.Builder notificationBuilder = 
new NotificationCompat.Builder(this) 
    .setSmallIcon(R.drawable.launchericon) 
    .setContentTitle("Mail ME") 
    .setContentText("Are you in need of help?? Click or slide to request help!") 
    .setLargeIcon(background) 
    .setStyle(new NotificationCompat.BigPictureStyle().bigPicture(background)) 
    .addAction(R.drawable.launchericon,"Help", contentIntent); 

我不知道我哪里出错了?

谢谢!

+0

在你问你关于android战争的问题,和android穿在你的描述中,你在说什么;);) –

+0

你试过.show()方法吗? –

回答

0

好像,当你使用BigPictureStyle它显示为Android Wear 3页:

  1. 文字常用通知
  2. 仅从.bigPicture(...)来电图像
  3. Open行动

检查,哪个位图实际上在这里R.drawable.backgroundwatch,因为你重新分配background变量两次:

Bitmap background = BitmapFactory.decodeResource(getResources(), R.drawable.backgroundwatch); 
+0

我这是一个错字。我只初始化了一次。如何解决这个问题? – TheDevMan

+0

你的主要问题是什么? 1)你不需要第二页或2)而不是图像,你会看到黑色的矩形? –

+0

有两个问题:1.我得到三页?根据上面的代码,我应该只有两个。 (第二页只是空的背景图片)2.我无法点击通知来完成某些操作? – TheDevMan