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

Crash after few times showing the quickaction #2

Closed
galex opened this issue Sep 2, 2011 · 3 comments
Closed

Crash after few times showing the quickaction #2

galex opened this issue Sep 2, 2011 · 3 comments

Comments

@galex
Copy link

galex commented Sep 2, 2011

Afer a few times tappting on the button like a monkey, the app crashes :

LogCat:

09-02 14:31:51.183: ERROR/AndroidRuntime(8552): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3129)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at android.view.View.measure(View.java:8313)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at android.view.ViewRoot.performTraversals(ViewRoot.java:839)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at android.os.Handler.dispatchMessage(Handler.java:99)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at android.os.Looper.loop(Looper.java:130)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at android.app.ActivityThread.main(ActivityThread.java:3683)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at java.lang.reflect.Method.invokeNative(Native Method)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at java.lang.reflect.Method.invoke(Method.java:507)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-02 14:31:51.183: ERROR/AndroidRuntime(8552): at dalvik.system.NativeStart.main(Native Method)

Screenshot : http://hpics.li/c69cd8f

Best regards,
Alexandre

@dan-ryan
Copy link

dan-ryan commented Oct 5, 2011

Also getting this problem. Anyone have a solution?

10-05 15:55:05.702: ERROR/AndroidRuntime(11608): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3129)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.view.View.measure(View.java:8330)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.view.ViewRoot.performTraversals(ViewRoot.java:843)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.os.Handler.dispatchMessage(Handler.java:99)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.os.Looper.loop(Looper.java:130)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at android.app.ActivityThread.main(ActivityThread.java:3835)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at java.lang.reflect.Method.invokeNative(Native Method)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at java.lang.reflect.Method.invoke(Method.java:507)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
10-05 15:55:05.702: ERROR/AndroidRuntime(11608): at dalvik.system.NativeStart.main(Native Method)

@dan-ryan
Copy link

dan-ryan commented Oct 5, 2011

Moving the lines:

mRootView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
mRootView.measure(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

to setRootViewId method seems to fix the crash.

public void setRootViewId(final int id) {
    mRootView   = inflater.inflate(id, null);
    mTrack      = (ViewGroup) mRootView.findViewById(R.id.tracks);

    mArrowDown  = (ImageView) mRootView.findViewById(R.id.arrow_down);
    mArrowUp    = (ImageView) mRootView.findViewById(R.id.arrow_up);

    mRootView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    mRootView.measure(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

    setContentView(mRootView);
}

@lorensiuswlt
Copy link
Owner

Fixed...thanx to Zammbi...

kashban pushed a commit to kashban/NewQuickAction3D that referenced this issue May 12, 2017
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

3 participants