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