TabLayout getting null value / NullPointerException
0
I am trying to make a three tab layout, but my code keeps returning a NullPointerException! I made another project just for that (following this tutorial: https://examples.javacodegeeks.com/android/core/widget/android-tablayout-example/ ), and everything worked perfectly. But when I made the same changes to my original project, "TabLayout" kept receiving "null", causing the application to crash when I request that specific activity. I tried debugging, but as I'm new to all of this, I couldn't figure anything out of it. Here is the code from the activity that's gonna "host" the tabs and stuff: public class Dashboard extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);