How android:configChanges=“orientation” flag affects ACTIVITY STACK when it includes translucent activities?

Have following Activities

  • MainActivity
  • TranslucentChildActivity
  • DialogGrandChildActivity

NOTE: android:configChanges="orientation" is mentioned in Manifest for TranslucentChildActivity so that doesn't get re-created

  1. MainParentActivity startActivityForResult --> TranslucentChildActivity
  2. TranslucentChildActivity startActivityForResult --> DialogGrandChildActivity
  3. Now change orientation
    • DialogGrandChildActivity should be destroyed and re-created
    • TranslucentChildActivity should also be affected as it is in the background of the dialog activity but since onConfigChange flag is set it shouldn't be destroyed
  4. BUT UNFORTUNATELY TranslucentChildActivity is also destroyed and re-created and onConfigurationChanged() callback isnt called which is surprising...

Questions:

  1. android:configChanges="orientation" flag isn't applicable to translucent activities?
  2. How do I stop this translucent activity from being re-cycled?

I tried quite a few ways without any success. I would appreciate any help.

Answers


My Observations:

  • Even though the translucent child activity has the flag set to handle its orientation change it will be ineffective if the MainParentActivity behind the translucent doesn't have the flag android:configChanges="orientation" set
  • Since the main parent is killed the whole activity stack will be destroyed and re-created
  • No matter if any child has any flag set
  • It will all be overridden

Need Your Help

How to call multiple different methods simultaneously

asp.net vb.net multithreading

I have some different methods that each import products from different sites.

Why are there different TEXT like macros for the same thing in win32?

c++ windows winapi

I want to know the reason why there are macros such as T, TEXT, _TEXT, __TEXT or __T when they all ultimately do the same thing.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.