i need to start my app from broadcast receiver/ se...
# android
d
i need to start my app from broadcast receiver/ service. i use this intent for it:
Copy code
val intent = Intent(context, SplashScreen.class).apply{
 addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
 setAction(Intent.ACTION_MAIN)
 intent.addCategory(Intent.CATEGORY_LAUNCHER)
}
startActivity(intent);
but seem it not working. some one can tell me reason why and give me solution for it!?
stackoverflow 2
1
l
@Dvt1405 This is not Kotlin related. Also, you cannot launch an Activity from the background on Android, you need to use a notification instead, and use a full screen intent if it's extremely urgent like an alarm clock or a phone call.
227 Views