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, null pointer exception #24

Open
gopalakrishnan-subramani opened this issue May 31, 2015 · 0 comments
Open

Crash, null pointer exception #24

gopalakrishnan-subramani opened this issue May 31, 2015 · 0 comments

Comments

@gopalakrishnan-subramani

Received a null pointer exception, crash the app, when I move drag object to right most,

I call setConfig to set the minLeft and maxLeft.

function onKnobMove(e) {
    console.log(e.source.knob, e.center, e.source.center);

    //var leftX = knobLeft.center.x;
    //var   rightX = knobRight.center.x;

    var leftX = knobLeft.rect.x  +  knobLeft.rect.width / 2;//gs

    var leftX = knobLeft.rect.x;//gs
    var rightX = knobRight.rect.x  +  knobRight.rect.width / 2; //gs


    console.log('left x', knobLeft.rect.x, 'leFtx', leftX);
    console.log('rightX', rightX);

    //knobRight.minLeft = leftX + (WIDTH / 2);
    knobRight.draggable.setConfig('minLeft',  leftX + WIDTH);
    knobRight.draggable.setConfig('maxLeft', _params.width - WIDTH);

    knobLeft.draggable.setConfig('maxLeft', rightX - WIDTH - (WIDTH / 2));
    knobLeft.draggable.setConfig('minLeft', 0);

    console.log('knobRight minLeft', knobRight.draggableConfig.minLeft);
    console.log('knobLeft maxLeft', knobLeft.draggableConfig.maxLeft);

    fillView.applyProperties({
        left: leftX,
        width: rightX - leftX
    });


    //leftValue (leftX + (WIDTH / 2)) / distance  //original
    //GS begin
    var values = {};
    values.leftValue = leftX / distance;
    values.rightValue = (rightX + (WIDTH / 2)) / distance;

    console.log("actual ", values);

    if (values.leftValue <= 0.05) {
        values.leftValue = 0;
    }

    if (values.rightValue >= 0.96) {
        values.rightValue = 1;
    }

    console.log("adjusted ", values);



    view.fireEvent('change', values);
    //GS End

    //view.fireEvent('change', {leftValue: (leftX + (WIDTH / 2)) / distance, rightValue: (rightX + (WIDTH / 2)) / distance});

}

[INFO] : undefined undefined undefined
[ERROR] : InputEventReceiver: Exception dispatching input event.
[WARN] : dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4be7648)
[ERROR] : TiApplication: (main) [15760,15760] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.5.0,2015/01/12 15:33,0014f83
[ERROR] : TiApplication: java.lang.NullPointerException
[ERROR] : TiApplication: at ti.draggable.DraggableGesture.drag(DraggableGesture.java:163)
[ERROR] : TiApplication: at ti.draggable.DraggableGesture.onTouch(DraggableGesture.java:125)
[ERROR] : TiApplication: at android.view.View.dispatchTouchEvent(View.java:7379)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2205)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1940)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1954)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1954)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1954)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1954)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1954)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1954)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1954)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2211)
[ERROR] : TiApplication: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1954)
[ERROR] : TiApplication: at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1966)
[ERROR] : TiApplication: at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1418)
[ERROR] : TiApplication: at android.app.Activity.dispatchTouchEvent(Activity.java:2424)
[ERROR] : TiApplication: at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.dispatchTouchEvent(ActionBarActivityDelegateICS.java:268)
[ERROR] : TiApplication: at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1914)
[ERROR] : TiApplication: at android.view.View.dispatchPointerEvent(View.java:7564)
[ERROR] : TiApplication: at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3883)
[ERROR] : TiApplication: at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3778)
[ERROR] : TiApplication: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
[ERROR] : TiApplication: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
[ERROR] : TiApplication: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
[ERROR] : TiApplication: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483)
[ERROR] : TiApplication: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
[ERROR] : TiApplication: at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540)
[ERROR] : TiApplication: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
[ERROR] : TiApplication: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
[ERROR] : TiApplication: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
[INFO] : lication: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
[ERROR] : TiApplication: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
[ERROR] : TiApplication: at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5419)
[ERROR] : TiApplication: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5399)
[ERROR] : TiApplication: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5370)
[ERROR] : TiApplication: at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5493)
[ERROR] : TiApplication: at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182)
[ERROR] : TiApplication: at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
[ERROR] : TiApplication: at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:174)
[ERROR] : TiApplication: at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:5472)
[ERROR] : TiApplication: at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:5512)
[ERROR] : TiApplication: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
[ERROR] : TiApplication: at android.view.Chore

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

1 participant