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

Crashes the activity on screen rotation #13

Open
mslavkovski opened this issue Feb 2, 2017 · 1 comment
Open

Crashes the activity on screen rotation #13

mslavkovski opened this issue Feb 2, 2017 · 1 comment

Comments

@mslavkovski
Copy link

It seems like the fragment doesn't restore the file name properly when instance state is created. I have tried to extend the custom fragment to gracefully save and restore the filename in the instance state but the problem is somewhere deeper in the library. Does anyone had the same issue?

Any solution?

@VivekThummar52
Copy link

You just have to add some code in onConfigurationChanged() method -

@Override
public void onConfigurationChanged(Configuration newConfig) {
    Log.v("Ringdroid", "EditActivity onConfigurationChanged");
    final int saveZoomLevel = mWaveformView.getZoomLevel();
    super.onConfigurationChanged(newConfig);

    loadGui();

    mHandler.postDelayed(new Runnable() {
        public void run() {
            mStartMarker.requestFocus();
            markerFocus(mStartMarker);

            mWaveformView.setZoomLevel(saveZoomLevel);
            mWaveformView.recomputeHeights(mDensity);

            updateDisplay();
        }
    }, 500);
}

Try this code and i'm new in android and this is my first answer on github so,please tell me if anything is missing or there is any mistake.

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

No branches or pull requests

2 participants