Errors Log: Android Studio Error I encountered & solved

 Android Studio problem [SOLVED]:


[1] Error Inflate XML in activity


Solution 1:

1. Remove <fragment tag from activity xml

2. Rather, replace it with a <FrameLayout

3. In activity class, simply setContentView(R.layout.fragment_register); //here, set the layout as the fragment id


Solution 2 (turns out my error is actually this)

1. Check the fragment class

2. My error was I did not inflate the fragment class 

------------

*note: any button or function should be made inside onViewCreated


[2] Error public void onComplete(@NonNull Task<AuthResult> task) { not succesful


Solution:

1. Add "uses INTERNET" in androidmanifest.xml

2. Make sure all variables in class User are accesible (make them public)


[3] Attempt to invoke virtual method 'void androidx.navigation.NavController.navigate(int)' on a null object reference


Solution:

1. Change navigate method 

from:

navController.navigate(R.id.action_registerFragment2_to_logIn);


to:

Navigation.findNavController(v).navigate(R.id.action_registerFragment2_to_logIn);


Comments

Popular posts from this blog

How to: Display Data from SQL Database in HTML Table - Bootstrap 5

HTML5: HTML Tags

How to: Display Data from Database in Pagination