-1

In my application when the user clicks on the application logo or title, system will open the navigation drawer. I want to make the navigation drawer to be open only if the navigation icon clicked, as i want to do some other logic if the user clicks application logo and title. How to perform that ?

This code is intended to open navigation drawer upon clicking application logo, title or navigation icon.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // toggle nav drawer on selecting action bar app icon/title
    if (mDrawerToggle.onOptionsItemSelected(item)) {
        return true;
    }
    // Handle action bar actions click
    switch (item.getItemId()) { 
    case R.id.action_settings:
        return true;
    default:
        return super.onOptionsItemSelected(item);
        //return false;
    }
}

Any advice is appreciated

1 Answers1

0

I Would advice you to create a custom Toolbar using a separate XML layout and use it in your Main layout,as it is easy. so the imageview and text View can serve for a specific purpose when clicked!