Mediastyle notification not proper seen when screen is lock - java

How can I fix this in mediastylenotifications?
I want to do that

Related

Disabling sound on Android's Ongoing notification updating

I have an Ongoing notification that shows Date and updates every minute inside a service. But in android 8 it plays sound in every update and users confused whats happening.
i set this:
builder.setPriority(NotificationCompat.PRIORITY_LOW);
This disabled the sound but has a side effect. Updating the Date is not working too! I want to update Notification without any sound. how it is possible?
In your notification channel try to set the sound to null. Like so:
channel.setSound(null, null);

Android media player stop playing in service

I already asked about it before, but my question even after edits about my progress of fix this noone answered to it anymore. This is original question:
Android media player stop playing while in background
So in short, I'm making music player app, but mediaPlayer stop sometimes when loading next song. After many tests I find out that it stops at mediaPlayer.prepare() and it won't continue as long as I don't trigger any action on phone like turning on display, volume up/down, click headset button. I'm out of ideas what can be a reason of it.
maybe you need to call prepareasync() instead of prepare().

How to detect light-up unlock and unlock of the screen in background

I am working on an android app trying to record the usage of the phone. For one function, I am trying to detect whether the screen is light up (not necessary to be unlocked), unlock and lock. How can I capture this three kinds of behavior of user?
Thanks!
Register a BroadcastReceiver
Use Intent.ACTION_SCREEN_OFF and ACTION_SCREEN_ON to detect screen on/off event
Guideline about how to use BroadcastReceiver can be found here
https://developer.android.com/guide/components/broadcasts.html

Lock screen implementation: Disable navigation buttons and notification access

I am building a Lock Screen that doesn't replace the stock Lock Screen, but instead allows the user to use "Swipe" to unlock and then shows my Lock Screen.
Therefore, I would like to know how I could possibly launch the Lock Screen immediately after the user has swiped to unlock, as a non dismissible activity.
By setting the activity's category as home, I was able to restrict some functionality but not entirely as the user could pull down the notification panel and enter apps or even press the recents apps button.

Calling onCreate() from locked screen

I am developing an android emergency app and I want to add a feature that can call a certain method from my activity class when the screen is locked. Is there anyway for my app to detect any kind gestures like shake, screen tap pattern or any kind of movement when the screen is locked?
Not sure if it will work, but I think you can put a listener in a service and put the servicee in the foreground. I have no clue what exactly youwant to achieve but this is what I can think of right now. BTW -- pass information from a service the foreground activity

Categories