Intent.setClass error
<p>I have the following ClickListener code. It will do different stuff depending on what button was pressed. If the Vehicle button is pressed I want it to start another activity by loading the Vehicles.class but it is erroring during the setClass() statement.I believe it is erroring when trying to instantiate the Vehicles class. The error returned is NoClassDefFoundError. </p>

<p>Can someone tell me what I'm doing wrong here?</p>

<p>Thanks
Patrick</p>

<p>OnClickListener code:</p>

<pre><code>    private OnClickListener mClickListener = new OnClickListener() {

    @Override
    public void onClick(View v) {

        Button btn = (Button) v;
        String txt = (String) btn.getText().toString();

        mSaveButton = (Button) findViewById(R.id.btnSaveTripInfo);
        mVehiclesButton = (Button) findViewById(R.id.btnVehicles);

        if(btn.equals(mSaveButton)) {
            onSaveClick(v);
        }else if (btn.equals(mStartStopButton)){
            onStartStopClick(v);
        }else if (btn.equals(mVehiclesButton)) {
            Intent intent = new Intent();
            intent.setClass(v.getContext(),Vehicles.class);
            startActivity(intent);
        }
    }

};
</code></pre>

<p>The Vehicles class code:</p>

<pre><code>public class Vehicles extends Activity  {

    private static final String TAG = "Vehicles";

    private static int m_id;
    private static String mVehName;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.vehicles);
    }
</code></pre>

<p>}</p>
