I am trying work with navigation component.
currently I have navigation view with menu.
I implement onNavigationItemSelected
in navigation view and detect click by
item.getItemId()
when there is clicks on specific items, it do something that not navigate to fragment. for example:
switch (item.getItemId()) {
case R.id.nav_share:
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = "shae StayTuned with friends bla bla bla and we can put app url in the google play " +
"if we don't will be sdk";
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Share via"));
break;
case R.id.nav_disconnect_user:
FirebaseAuth.getInstance().signOut();
break;
}
how I can achieve that with navigation component?
thanks!