Created
October 7, 2019 19:03
-
-
Save bariskarapinar/3da73102b87740ca353f687cccdf70c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.firebaseauthproject; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.MenuItem; | |
import android.widget.Toast; | |
import android.support.design.widget.BottomNavigationView; | |
public class HomeActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_home); | |
BottomNavigationView bottomNavigationView = (BottomNavigationView) | |
findViewById(R.id.bottom_navigation); | |
bottomNavigationView.setOnNavigationItemSelectedListener( | |
new BottomNavigationView.OnNavigationItemSelectedListener() { | |
@Override | |
public boolean onNavigationItemSelected(@NonNull MenuItem item) { | |
switch (item.getItemId()) { | |
case R.id.action_favorites: | |
Toast.makeText(getApplicationContext(), "Favorites", Toast.LENGTH_SHORT).show(); | |
break; | |
case R.id.action_home: | |
Toast.makeText(getApplicationContext(), "Home", Toast.LENGTH_SHORT).show(); | |
break; | |
case R.id.action_profile: | |
Intent inentProfile = new Intent(HomeActivity.this, ProfileActivity.class); | |
startActivity(inentProfile); | |
break; | |
} | |
return true; | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment