Navigation Component prevent to recreate fragment on back press

Of course, we can not prevent calling oncrateView, but there is a simple way. Instead of calling view.loadData() in onCreateView or other lifecycle methods we can call it while initializing ViewModel this article helped me to know ViewModel better 5 common mistakes when using Architecture Components Update: The current navigation component (V 2.3.0) doesn’t support … Read more

Difference and uses of onCreate(), onCreateView() and onActivityCreated() in fragments

UPDATE: onActivityCreated() is deprecated from API Level 28. onCreate(): The onCreate() method in a Fragment is called after the Activity‘s onAttachFragment() but before that Fragment‘s onCreateView(). In this method, you can assign variables, get Intent extras, and anything else that doesn’t involve the View hierarchy (i.e. non-graphical initialisations). This is because this method can be … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)