notification channel
This commit is contained in:
parent
d9cac31962
commit
5f63674799
1 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,8 @@ import androidx.annotation.Nullable;
|
|||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.PictureInPictureParams;
|
||||
import android.content.Context;
|
||||
|
@ -71,6 +73,12 @@ public class VideoPlayer extends AppCompatActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_video_player);
|
||||
if(Build.VERSION.SDK_INT >=Build.VERSION_CODES.O){
|
||||
|
||||
NotificationChannel channel= new NotificationChannel("playback","Test Notification",NotificationManager.IMPORTANCE_DEFAULT);
|
||||
NotificationManager manager =getSystemService(NotificationManager.class);
|
||||
manager.createNotificationChannel(channel);
|
||||
}
|
||||
appOpsManager = (AppOpsManager)getSystemService(Context.APP_OPS_SERVICE);
|
||||
mediaSession = new MediaSessionCompat(this, getPackageName());
|
||||
mediaSessionConnector = new MediaSessionConnector(mediaSession);
|
||||
|
|
Loading…
Reference in a new issue