大家好,我正在通知,在课堂上NotificationUtils
我收到这样的错误。
Builder (Context) in Builder cannot be applied to (Context, java.lang.String)
错误线
final NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext, CHANNEL_ID);
通道 - private static final String CHANNEL_ID = "myChannel";
它是什么,我该如何修复它?在另一个项目中,它工作正常。如果您删除CHANNEL_ID,通知会到达,但活动不会打开,通知文本应写入其中。
进口
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;
import android.text.Html;
import com.whrsmxmx.vk_api_test.MapsActivity;
import com.whrsmxmx.vk_api_test.PushTest;
import com.whrsmxmx.vk_api_test.R;
import com.whrsmxmx.vk_api_test.vo.NotificationVO;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
构建.gradle
implementation 'com.android.support:appcompat-v7:23.0.0'
implementation 'com.google.android.gms:play-services-maps:9.4.0'
implementation 'com.google.android.gms:play-services:9.4.0'
implementation 'com.android.support:multidex:1.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.google.firebase:firebase-core:9.4.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.google.firebase:firebase-database:9.4.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.vk:androidsdk:1.6.5'
compile 'com.squareup.picasso:picasso:2.5.2'
testCompile 'junit:junit:4.12'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
//Новый хлам от уведомлений и т.д
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'com.google.firebase:firebase-messaging:9.4.0'
implementation 'com.squareup.picasso:picasso:2.71828'