This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi there.. as the title says, how can I call a method in an activity without bringing the app to the front? For example, when one gets a notification of a new mail and presses the "Delete" button inside the notification, the notification is dismissed and the mail is deleted in the background without starting the app.
The only way I found to do it is to keep a static reference to the main activity and using that reference to call a public method from a BroadcastReceiver, but that only works if the activity is alive. If I launch an intent for the activity, it's started and brought to the front.
Does anyone know how app achieve that behavior?
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/androiddev/...