Last active
September 26, 2017 20:02
-
-
Save kcrimi/4511fb0afed3f22ae59abd69fdc5f981 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ViewA { | |
protected ImageView mImageView; | |
public void ViewA() { | |
initView(); | |
} | |
public void initView() { | |
inflateView(R.layout.my_view); | |
mImageView = (ImageView) findViewById(R.id.image); | |
Timber.d("image is null" + mImageView == null); // false | |
} | |
public void getImage() { | |
return mImageView; | |
} | |
} | |
public class ViewB extends ViewA { | |
public void ViewB() { | |
super(); | |
} | |
public void initView() { | |
super.initView() | |
Timber.d("image is null" + mImageView == null); // true | |
Timber.d("image through getter" + getImage == null); // false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment