1

My app gives me this error when using this onclicklistener

private OnClickListener btn_Config_Onclick = new OnClickListener() {
    public void onClick(View v) {
        Bundle bundle = new Bundle();
        bundle.putString("Name", selected_Name);
        bundle.putString("Image", selected_Image);

        Intent intent = new Intent(v.getContext(), Configure.class);
        intent.putExtras(bundle);
        v.getContext().startActivity(intent);
    }
};

The class for configure is here: http://pastebin.com/njMa9buE

and the complete error here: http://pastebin.com/REemSken

I have been looking over everything and cant for the life of me find whats wrong, everything is correctly defined in the manifest etc. Hoping fresh eyes will find the issue

6
  • 1
    Are all your Activities correctly defined in the Manifest file? Commented Jul 12, 2012 at 9:02
  • Post Logcat errors, I m sure the NPE is in Configure.class Commented Jul 12, 2012 at 9:02
  • 1
    have you declared configure class in manifest file Commented Jul 12, 2012 at 9:02
  • Yes i already said its defined in the manifest, and the complete logcat of the error is here pastebin.com/REemSken Commented Jul 12, 2012 at 9:04
  • Which one is Configure.java:59 code line? Commented Jul 12, 2012 at 9:04

1 Answer 1

3

You never initialize chk_RunVNC. It is null. You never assign anything to it. So this throws a NullPointerException in onCreate():

chk_RunVNC.setOnCheckedChangeListener(chk_RunVNC_OnCheckedChange);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.