Okay, so i finally got my button to start my new activity from the main activity. now, the problem i have is that when the new activity starts, the avd gives me an error saying "unfortunately, yourApp has stopped working". I tried for hours to detect the problem untill i began to comment some part of the new activity's code and then finally, i found it. keep in mind, that almost all the variables i used in the new activity also had common names and ids to those in the mainActivity, but this should not be the problem since i am not passing anything through both activities...at least not now. The problem was from the spinners. their declaration worked fine...i guess, the findViewByid method gave no problem, the arrayAdapter also gave no problems but i noticed that the app only shuts down when i remove the comments from the onItemSelectedListener and the setAdapters methods. i don't know why this happens. i used the same code for the mainActivity and it works perfectly. Dunno if i overloaded the onCreate method but as i said earlier, it works fine in the mainActivity. the new activity code for th onCreate method is given below...the other parts of the code works fine.

```
public class firstYearSecondSemester2 extends Activity implements AdapterView.OnItemSelectedListener {

private String[] grades;
public Spinner spinner0, spinner1, spinner2, spinner3, spinner4, spinner5, spinner6, spinner7, spinner8;
private double[] grade_values = {0.0, 5.0, 4.0, 3.0, 2.0, 1.0, 0.0};
//private Spinner gpa_grade0, gpa_grade1, gpa_grade2, gpa_grade3, gpa_grade4, gpa_grade5;
private double gpa_grade_0, gpa_grade_1, gpa_grade_2, gpa_grade_3, gpa_grade_4, gpa_grade_5, gpa_grade_6, gpa_grade_7, gpa_grade_8;
private TextView gpa, gpa_credits0, gpa_credits1, gpa_credits2, gpa_credits3, gpa_credits4,gpa_credits5, gpa_credits6, gpa_credits7,gpa_credits8;
private int gpa_credits_0, gpa_credits_1, gpa_credits_2, gpa_credits_3, gpa_credits_4, gpa_credits_5, gpa_credits_6, gpa_credits_7, gpa_credits_8;
public int[] spinner_ids;
public int spinner_check;
public int spinner_index;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_first_year_second_semester2);

    spinner_ids = new int[9];
    spinner_check = 0;
    spinner_index = 0;
    gpa = (TextView) findViewById(R.id.gpa_results_text);

    grades = getResources().getStringArray(R.array.grades);

    gpa_credits0 = (TextView) findViewById(R.id.gpa_credits_0);
    gpa_credits1 = (TextView) findViewById(R.id.gpa_credits_1);
    gpa_credits2 = (TextView) findViewById(R.id.gpa_credits_2);
    gpa_credits3 = (TextView) findViewById(R.id.gpa_credits_3);
    gpa_credits4 = (TextView) findViewById(R.id.gpa_credits_4);
    gpa_credits5 = (TextView) findViewById(R.id.gpa_credits_5);
    gpa_credits6 = (TextView) findViewById(R.id.gpa_credits_6);
    gpa_credits7 = (TextView) findViewById(R.id.gpa_credits_7);
    gpa_credits8 = (TextView) findViewById(R.id.gpa_credits_8);

    spinner0 = (Spinner) findViewById(R.id.gradeSpinner0);
    spinner1 = (Spinner) findViewById(R.id.gradeSpinner1);
    spinner2 = (Spinner) findViewById(R.id.gradeSpinner2);
    spinner3 = (Spinner) findViewById(R.id.gradeSpinner3);
    spinner4 = (Spinner) findViewById(R.id.gradeSpinner4);
    spinner5 = (Spinner) findViewById(R.id.gradeSpinner5);
    spinner6 = (Spinner) findViewById(R.id.gradeSpinner6);
    spinner7 = (Spinner) findViewById(R.id.gradeSpinner7);
    spinner8 = (Spinner) findViewById(R.id.gradeSpinner8);

    ArrayAdapter<String> each_grade = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, grades);

    each_grade.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

    spinner0.setAdapter(new NothingSelectedSpinnerAdapter(each_grade, R.layout.contact_spinner_row_nothing_selected,/* R.layout.contact_spinner_nothing_selected_dropdown, // Optional*/this));
    spinner1.setAdapter(new NothingSelectedSpinnerAdapter(each_grade, R.layout.contact_spinner_row_nothing_selected,/* R.layout.contact_spinner_nothing_selected_dropdown, // Optional*/this));
    spinner2.setAdapter(new NothingSelectedSpinnerAdapter(each_grade, R.layout.contact_spinner_row_nothing_selected,/* R.layout.contact_spinner_nothing_selected_dropdown, // Optional*/this));
    spinner3.setAdapter(new NothingSelectedSpinnerAdapter(each_grade, R.layout.contact_spinner_row_nothing_selected,/* R.layout.contact_spinner_nothing_selected_dropdown, // Optional*/this));
    spinner4.setAdapter(new NothingSelectedSpinnerAdapter(each_grade, R.layout.contact_spinner_row_nothing_selected,/* R.layout.contact_spinner_nothing_selected_dropdown, // Optional*/this));
    spinner5.setAdapter(new NothingSelectedSpinnerAdapter(each_grade, R.layout.contact_spinner_row_nothing_selected,/* R.layout.contact_spinner_nothing_selected_dropdown, // Optional*/this));
    spinner6.setAdapter(new NothingSelectedSpinnerAdapter(each_grade, R.layout.contact_spinner_row_nothing_selected,/* R.layout.contact_spinner_nothing_selected_dropdown, // Optional*/this));
    spinner7.setAdapter(new NothingSelectedSpinnerAdapter(each_grade, R.layout.contact_spinner_row_nothing_selected,/* R.layout.contact_spinner_nothing_selected_dropdown, // Optional*/this));
    spinner8.setAdapter(new NothingSelectedSpinnerAdapter(each_grade, R.layout.contact_spinner_row_nothing_selected,/* R.layout.contact_spinner_nothing_selected_dropdown, // Optional*/this));

    spinner0.setOnItemSelectedListener(firstYearSecondSemester2.this);
    spinner1.setOnItemSelectedListener(firstYearSecondSemester2.this);
    spinner2.setOnItemSelectedListener(firstYearSecondSemester2.this);
    spinner3.setOnItemSelectedListener(firstYearSecondSemester2.this);
    spinner4.setOnItemSelectedListener(firstYearSecondSemester2.this);
    spinner5.setOnItemSelectedListener(firstYearSecondSemester2.this);
    spinner6.setOnItemSelectedListener(firstYearSecondSemester2.this);
    spinner7.setOnItemSelectedListener(firstYearSecondSemester2.this);
    spinner8.setOnItemSelectedListener(firstYearSecondSemester2.this);

}

```

Logcat Messages

```
   04-14 02:21:16.260    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 D/dalvikvm﹕ Not late-enabling CheckJNI (already on)
04-14 02:21:16.830    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 I/dalvikvm﹕ Could not find method android.view.ViewGroup.onNestedScrollAccepted, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onNestedScrollAccepted
04-14 02:21:16.830    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 W/dalvikvm﹕ VFY: unable to resolve virtual method 11350: Landroid/view/ViewGroup;.onNestedScrollAccepted (Landroid/view/View;Landroid/view/View;I)V
04-14 02:21:16.830    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 D/dalvikvm﹕ VFY: replacing opcode 0x6f at 0x0000
04-14 02:21:16.830    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 I/dalvikvm﹕ Could not find method android.view.ViewGroup.onStopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onStopNestedScroll
04-14 02:21:16.830    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 W/dalvikvm﹕ VFY: unable to resolve virtual method 11356: Landroid/view/ViewGroup;.onStopNestedScroll (Landroid/view/View;)V
04-14 02:21:16.830    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 D/dalvikvm﹕ VFY: replacing opcode 0x6f at 0x0000
04-14 02:21:16.830    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 I/dalvikvm﹕ Could not find method android.support.v7.internal.widget.ActionBarOverlayLayout.stopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.setHideOnContentScrollEnabled
04-14 02:21:16.830    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 W/dalvikvm﹕ VFY: unable to resolve virtual method 9044: Landroid/support/v7/internal/widget/ActionBarOverlayLayout;.stopNestedScroll ()V
04-14 02:21:16.830    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x000e
04-14 02:21:16.910    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
04-14 02:21:16.910    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 W/dalvikvm﹕ VFY: unable to resolve virtual method 368: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
04-14 02:21:16.910    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
04-14 02:21:16.910    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
04-14 02:21:16.910    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 W/dalvikvm﹕ VFY: unable to resolve virtual method 390: Landroid/content/res/TypedArray;.getType (I)I
04-14 02:21:16.910    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
04-14 02:21:17.150    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 D/dalvikvm﹕ GC_FOR_ALLOC freed 140K, 8% free 3075K/3340K, paused 0ms, total 5ms
04-14 02:21:17.150    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 I/dalvikvm-heap﹕ Grow heap (frag case) to 4.195MB for 1127532-byte allocation
04-14 02:21:17.210    1772-1781/com.daftnerds.juliusugochukwu.cgpa4 D/dalvikvm﹕ GC_FOR_ALLOC freed 13K, 7% free 4163K/4444K, paused 3ms, total 4ms
04-14 02:21:18.930    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 I/Choreographer﹕ Skipped 103 frames!  The application may be doing too much work on its main thread.
04-14 02:21:18.930    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 D/gralloc_goldfish﹕ Emulator without GPU emulation detected.
04-14 02:27:17.189    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 I/Choreographer﹕ Skipped 60 frames!  The application may be doing too much work on its main thread.
04-14 02:27:17.309    1772-1772/com.daftnerds.juliusugochukwu.cgpa4 D/dalvikvm﹕ GC_FOR_ALLOC freed 168K, 7% free 4507K/4796K, paused 2ms, total 2ms
04-14 02:29:34.831    2264-2264/com.daftnerds.juliusugochukwu.cgpa4 D/gralloc_goldfish﹕ Emulator without GPU emulation detected.

```

Now, once i click the button to start the new activity, this happens

```
04-14 02:30:40.562    2264-2264/com.daftnerds.juliusugochukwu.cgpa4 D/AndroidRuntime﹕ Shutting down VM
04-14 02:30:40.562    2264-2264/com.daftnerds.juliusugochukwu.cgpa4 W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xb0d3cb20)
04-14 02:30:40.602    2264-2264/com.daftnerds.juliusugochukwu.cgpa4 E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.daftnerds.juliusugochukwu.cgpa4, PID: 2264
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.daftnerds.juliusugochukwu.cgpa4/com.daftnerds.juliusugochukwu.cgpa4.firstYearSecondSemester2}: java.lang.NullPointerException
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NullPointerException
            at com.daftnerds.juliusugochukwu.cgpa4.firstYearSecondSemester2.onCreate(firstYearSecondSemester2.java:76)
            at android.app.Activity.performCreate(Activity.java:5231)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)

```