From 063850b3d8256f3567a21e66ea082a1628b81953 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 24 Apr 2015 00:58:13 +0200 Subject: [PATCH] Fixed lint API warnings. --- .../com/nutomic/ensichat/util/AddContactsHandler.scala | 9 +++++---- .../com/nutomic/ensichat/util/NotificationHandler.scala | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/scala/com/nutomic/ensichat/util/AddContactsHandler.scala b/app/src/main/scala/com/nutomic/ensichat/util/AddContactsHandler.scala index 96d0b23..71b8ead 100644 --- a/app/src/main/scala/com/nutomic/ensichat/util/AddContactsHandler.scala +++ b/app/src/main/scala/com/nutomic/ensichat/util/AddContactsHandler.scala @@ -1,14 +1,15 @@ package com.nutomic.ensichat.util -import android.app.{Notification, NotificationManager, PendingIntent} +import android.app.{NotificationManager, PendingIntent} import android.content.{Context, Intent} +import android.support.v4.app.NotificationCompat import android.util.Log import android.widget.Toast import com.nutomic.ensichat.R import com.nutomic.ensichat.activities.ConfirmAddContactActivity import com.nutomic.ensichat.protocol.ChatService.OnMessageReceivedListener -import com.nutomic.ensichat.protocol.body.{ResultAddContact, RequestAddContact} -import com.nutomic.ensichat.protocol.{Message, Address, User} +import com.nutomic.ensichat.protocol.body.{RequestAddContact, ResultAddContact} +import com.nutomic.ensichat.protocol.{Address, Message, User} /** * Handles [[RequestAddContact]] and [[ResultAddContact]] messages, adds new contacts. @@ -50,7 +51,7 @@ class AddContactsHandler(context: Context, getUser: (Address) => User, localAddr val pi = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT) - val notification = new Notification.Builder(context) + val notification = new NotificationCompat.Builder(context) .setContentTitle(context.getString(R.string.notification_friend_request, getUser(remote))) .setSmallIcon(R.drawable.ic_launcher) .setContentIntent(pi) diff --git a/app/src/main/scala/com/nutomic/ensichat/util/NotificationHandler.scala b/app/src/main/scala/com/nutomic/ensichat/util/NotificationHandler.scala index 0f5e0ec..41b56f6 100644 --- a/app/src/main/scala/com/nutomic/ensichat/util/NotificationHandler.scala +++ b/app/src/main/scala/com/nutomic/ensichat/util/NotificationHandler.scala @@ -2,6 +2,7 @@ package com.nutomic.ensichat.util import android.app.{Notification, NotificationManager, PendingIntent} import android.content.{Context, Intent} +import android.support.v4.app.NotificationCompat import com.nutomic.ensichat.R import com.nutomic.ensichat.activities.MainActivity import com.nutomic.ensichat.protocol.ChatService.OnMessageReceivedListener @@ -21,7 +22,7 @@ class NotificationHandler(context: Context) extends OnMessageReceivedListener { return val pi = PendingIntent.getActivity(context, 0, new Intent(context, classOf[MainActivity]), 0) - val notification = new Notification.Builder(context) + val notification = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.ic_launcher) .setContentTitle(context.getString(R.string.notification_message)) .setContentText(text.text)