I have a Foreground Screen Activity ComponentName. I can get the context object from the same. But I need an instance of activity. How to get activity link from ComponentName. All this code will be written to the service.
Thanks in advance.
I will need a little more clarity about what you are trying to do, but maybe:
class ActivityWatcher using the onActivityStarted (or similar) method
class ActivityWatcher
onActivityStarted
to call a class that follows your view. Hierarchy
This will at least give you all the views from the action layout that were defined at the time the operation was created.
You cannot get an instance of an Activity from its component name. You can save an instance of Activity as a static field in the class (when calling the onCreate Activity method) and get this field in the service.
And what do you want to do with the Activity instance in the service?
Source: https://habr.com/ru/post/1437772/More articles:EF code Exclude column first - c #ddply + sum function column name - rDuplicate target: Xcode cannot work with the selected destination - xcodePreprocessor macro and weirdness BOOL - c-preprocessorChoosingin groups of 3 - jqueryIs it possible to localize strings directly in the iOS storyboard without using code? - iosoverride event display in full calendar - jqueryEmacs 24 Keyboard Macros Are Slow - emacsUsing javaagent with Android - javaHow to send email to multiple users in magento - phpAll Articles