diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index 1e990f71..a37ab581 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -1,14 +1,29 @@ package one.nem.lacerta; import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.FragmentManager; +import androidx.navigation.NavController; +import androidx.navigation.fragment.NavHostFragment; +import androidx.navigation.ui.NavigationUI; import android.os.Bundle; +import com.google.android.material.bottomnavigation.BottomNavigationView; + public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + + // Debug + FragmentManager supportFragmentManager = getSupportFragmentManager(); + + NavHostFragment navHostFragment = (NavHostFragment) supportFragmentManager.findFragmentById(R.id.nav_host_fragment); + NavController navController = navHostFragment.getNavController(); + BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav); + + NavigationUI.setupWithNavController(bottomNavigationView, navController); } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index c89e52b8..b57b8f9b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -15,7 +15,7 @@ app:layout_constraintStart_toStartOf="parent" /> + + + + + + \ No newline at end of file