janishar/android-mvp-architecture

mOpenSourceAdapter is null

Themesaul opened this issue · 2 comments

https://github.com/MindorksOpenSource/android-mvp-architecture/blob/4191a3c325a2464811fdf4c3733731f54b4902a5/app/src/main/java/com/mindorks/framework/mvp/ui/feed/opensource/OpenSourceFragment.java#L100

Sometimes mOpenSourceAdapter is null and it hangs.

Reproduce the problem in an easy way:

1- Start an intent to youtube

Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(String.format("http://www.youtube.com/watch?v=%s", KEY))); intent.putExtra("force_fullscreen", true); itemView.getContext().startActivity(intent);

2- Press 4 times or more the button back before the video is opened

2.1 - The "onDestroyView" method is triggered when it does not have to.

3 - mOpenSourceAdapter is null and the application closes

I have tried to check if it is null and in the case that it is to start a new instance of OpenSourceAdapter but the application does not respond.

Is this normal?

The problem was related to variables that were null by the change of view (the activity was destroyed) has been my problem. It only happened with the change of quick view back from the landscape mode for some strange reason.

The problem was related to variables that were null by the change of view (the activity was destroyed) has been my problem. It only happened with the change of quick view back from the landscape mode for some strange reason.