Search code examples
androidandroid-activityonconfigurationchanged

Running an activity inside an activity?


I am developing a library for Android. This lib consist of a custom view. I'd like to be able to detect from my lib when onConfigurationChanged() is called for the activity.

My first thought was to use startActivity() with my own activity that only implement onConfigurationChanged(), but unfortunatly this start a new activity on top of the application. Is it possible to run an activity in "background"?

Maybe I am having the wrong approach? Do you have any idea of how I can achieve this?


Solution

  • So the way I was trying to solve it wasn't googd.

    I added a method onConfigurationChanged() to my lib. That way, people using it will have to call this method from their activity.

    Problem solved!