62.3 Creating the Notification Channel
As with the example in the previous chapter, a channel must be created before a notification can be sent. Edit the MainActivity.java file and add code to create a new channel as follows:
.
.
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.graphics.Color;
.
.
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
private NotificationManager notificationManager;
private final String channelID = "com.ebookfrenzy.directreply.news";
@Override
protected void onCreate(Bundle savedInstanceState) {
.
.
notificationManager =
&...