Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

User Settings are opened on clicking back button in Trustees Fragment #458

Open
abs51295 opened this issue Apr 25, 2017 · 5 comments
Open
Assignees

Comments

@abs51295
Copy link
Member

abs51295 commented Apr 25, 2017

Expected Behavior:

The application should navigate back to Circle Of Trust when clicking back button in Trustees Fragment.

Actual Behavior:

It navigates to User Settings.

trustees

@sandarumk I would like to work on this issue. Thanks :)

@codingblazer
Copy link
Member

I can't duplicate this issue. Have you fetched recent code changes ?

@HimanshuS01
Copy link

HimanshuS01 commented Apr 25, 2017

Hey @abs51295 this is working fine on my device. I am unable to recreate the same issue

@abs51295
Copy link
Member Author

abs51295 commented Apr 25, 2017

Hey @codingblazer @HimanshuS01 yes I have already updated the code and I found the problem in the code inside the Trustees file. Here is the snippet:

 @Override 
    public boolean onOptionsItemSelected(MenuItem item) { 
        switch (item.getItemId()) { 
            case android.R.id.home: 
                finish();
            case R.id.menu_settings:
                Intent intent=new Intent(this, UserSettingsActivity.class);
                startActivity(intent);
        }
        return true;
    }

Here there is no break; inside the case android.R.id.home. So what happens is it continues to execute the remaining case and enters R.id.menu_settings to create a SettingsActivity instance. I don't know how it's working fine on your devices but logically it shouldn't.

Hope that clears it up :)

@codingblazer
Copy link
Member

codingblazer commented Apr 25, 2017

@abs51295 Oh!! I was using the device Back button.
It is a valid issue. Thanks for the explanation :-)

@sandarumk
Copy link

Is it still there. If so please feel free to continue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants