63.2 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 NotificationManager notificationManager;
private final String channelID = "com.ebookfrenzy.directreply.news";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_direct_reply);
&...