java - Class's object initialized in Parent activity re-initialized in child activity -



java - Class's object initialized in Parent activity re-initialized in child activity -

i have object initialized in activity(parent activity) kid activity extends parent activity re-initializing object whenever kid activity's oncreate executed.

breakdown: 1. on parent's oncreate class's object gets initialized under condition:

if(obj == null){ init(); }

2. kid activity started (extends parent activity) at moment parent's oncreate gets called due super.oncreate() , somehow ignores parent's status run init() in #1.

can point me how can past situation?

update: anyone..? :(

so, firstly, controller null in oncreate(). reason you're seeing controller null in kid activity because you're logging it's value before you're calling super.oncreate() (which calls parent's oncreate() , initializes controller).

java android object inheritance parent-child

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -