Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotate the screen, the loacation come back to START_PATH #3

Open
GoogleCodeExporter opened this issue Mar 14, 2016 · 4 comments
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. open the filedialog with the START_PATH: /
2. select a directory, such as /etc
3. rotate the screen, the loacation come back to START_PATH

What is the expected output? What do you see instead?
The location should keep the same when the screen was rotated.
I see the loaction come back to START_PATH instead.

What version of the product are you using? On what operating system?
I found this problem in android 2.1, 2.2

Please provide any additional information below.
to fix this problem, the onPause method should be overrided.

    @Override
    protected void onPause() {
        String myPathStr = myPath.getText().toString();
        int idx = myPathStr.lastIndexOf(':');
        String currPath = myPathStr.substring(idx + 2);
        getIntent().putExtra(START_PATH, currPath);
        super.onPause();
    }






Original issue reported on code.google.com by stevens...@gmail.com on 1 Aug 2011 at 12:49

@GoogleCodeExporter
Copy link
Author

ok, thanks a lot :)
I'll try to add your fix in near time

Original comment by alexande...@gmail.com on 2 Aug 2011 at 5:28

@GoogleCodeExporter
Copy link
Author

Most likely the bug will be fixed today

Original comment by alexande...@gmail.com on 18 Aug 2011 at 6:38

  • Added labels: Priority-High
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

You should onRetainNonConfigurationInstance() and not use onPause().

Submitting patch.

Original comment by twig.ngu...@gmail.com on 10 Feb 2012 at 9:03

Attachments:

@GoogleCodeExporter
Copy link
Author

Fixed it using the following code on FileDialog.java:

@Override
    public void onSaveInstanceState(Bundle savedInstanceState) {
        super.onSaveInstanceState(savedInstanceState);

        savedInstanceState.putString("CurrentPath", currentPath);

    }

    @Override
    public void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);

        currentPath = savedInstanceState.getString("CurrentPath");

        getDir(currentPath);

    }

Original comment by brunomac...@gmail.com on 26 May 2013 at 6:54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant