I have a ChromeOS 100 Acer Chromebook 314. I open the app, I am logged in, and after that I will close it from the top-right corner. Then I receive a notification and I run this code:
try {
val intentActivity = Intent(context, IncomingCallActivity::class.java)
intentActivity.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
context.startActivity(intentActivity)
} catch (e: Exception) {
FL.e(TAG, "makeCall()::Failed -> cannot start activity: ${e.message}")
}
This does not fail, but does not open the activity neither.
I have also tried:
PendingIntent.getActivity(context, 12346, intentActivity, PendingIntent.FLAG_IMMUTABLE).send()
But same issue. This works fine on phones. BUT on phones I am running this from the ConnectionService.onShowIncomingCall. I cannot use that because there is no ConnectionService in the chromeOS api. Any idea I can make my activity appear properly always?
Fixed it by requesting permission to drawOverlays