I am trying to make a basic dice roller for a card game. It is on the second screen of two. The screen opens fine when I press the button to open it, but when I click the dice button the app simply crashes. I am using the newest version of Android Studio. Here's my code:
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;
import java.util.Random;
import static android.R.attr.value;
public class Extras extends AppCompatActivity implements OnClickListener{
    Button btn1;
    TextView numberGenerator;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_extras);
        btn1 = (Button) findViewById(R.id.diceButton);
        btn1.setOnClickListener(this);
        numberGenerator = (TextView)findViewById(R.id.numberGenerator);
    }
    @Override
    public void onClick(View v) {
        int min = 1;
        int max = 6;
        Random random = new Random();
        int value = random.nextInt(max - min) + min;
        numberGenerator.setText(value+"");
        if (v == btn1) {
            numberGenerator.setText(value);
        }
    }
    ...
}
 
     
     
    