I am new to android development.
I am trying to create an app in which on button click I will be able to go to other page or activity. App crashes when I click compute or algorithm button.
Please let me know what I am doing wrong.
package com.example.myfirstapp;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class Main3Activity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);
    }
    public void algorithm1(View view) {
        Intent intent = new Intent(this, algorithm.class);
        startActivity(intent);
    }
    public void compute(View view){
        Intent intent = new Intent(this,result.class);
        startActivity(intent);
    }
}
xml code for button
<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Algorithm"
    android:id="@+id/button7"
    android:layout_gravity="center_horizontal"
    android:onClick="algorithm1"/>
 
     
     
    