Android Question Open a module or activity with the service in the background

Helio

Member
I'm developing an alarm app that uses a background service and I'd like an activity (module or page) to open when the alarm goes off. I searched the forum and found that StartActivity cannot be used with the background service unless it has a permission to draw on top of other applications. Well, I used that permission, but it still gives an error. The error is as follows:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference
Where am I going wrong?
 

Helio

Member
I tested it in release mode and the error log is pretty much the same!

 
Upvote 0

Helio

Member
I managed to make it work. It is now opening the MainPage for me to place a mgbox there. However, I can only open MainPage with StartActivity. Could I open other modules besides MainPage?

As for Service_Start, I'm using it to manage my alarms, that's all. Or have you detected something wrong that I could be doing?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…