Well, I wanted to know how I can add this (intent) and how to start it at the end of the program in another Class.
public class Main2Activity extends AppCompatActivity implements View.OnClickListener{
int points = 0;
Button next;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
next = (Button) findViewById(R.id.next);
next.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.option1:
points = points + 0;
break;
case R.id.correctly:
points = points + 1;
break;
case R.id.option3:
points = points + 0;
break;
case R.id.option4:
points = points + 0;
break;
case R.id.option5:
points = points + 0;
break;
}
if (next.isPressed()) {
Intent intent = new Intent(this, Main3Activity.class);
intent.putExtra("pontuação", points);
startActivity(intent);
apply(intent);
}
}
}