Last active
June 24, 2019 09:30
-
-
Save ankitdubey021/8e1bfb807ed9f3caf7633459acb3b949 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
bar.setNavigationOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Toast.makeText(getApplicationContext(),"Home Clicked",Toast.LENGTH_LONG).show(); | |
} | |
}); | |
bar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { | |
@Override | |
public boolean onMenuItemClick(MenuItem item) { | |
switch (item.getItemId()){ | |
case R.id.edit: | |
Toast.makeText(getApplicationContext(),"Edit Clicked",Toast.LENGTH_LONG).show(); | |
break; | |
case R.id.home: | |
Toast.makeText(getApplicationContext(),"Home Clicked",Toast.LENGTH_LONG).show(); | |
break; | |
case R.id.contact: | |
Toast.makeText(getApplicationContext(),"Contact Clicked",Toast.LENGTH_LONG).show(); | |
break; | |
} | |
return false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment