1
I needed that when I entered the Fragment
he executed this method Verifcar()
in main Activity
to check the condition and not show the RecyclerView
.
Mainactivity.Java
public void Verificar(){
if(pref.getBoolean(Constants.IS_LOGGED_IN,false)){
recyclerView.setVisibility (View.VISIBLE);
}else {
recyclerView.setVisibility (View.INVISIBLE);
}
}
Thank you for your suggestion, but I would like you to call this method by being called the Fragment in this case where I should place the method in the body of the Fragment ?
– Marcos Paulo
I recommend a override in your Fragment’s onActivityCreated() method. So it would only be called after the Views initialization.
– Julian Alberto
Boy You’re a Genius, Success and thank you so much.
– Marcos Paulo
If the answer served you, please mark it as the correct answer so that others know that this solution served. Success for you too
– Julian Alberto