N
N
nikita_chiru2016-07-08 02:16:57
Java
nikita_chiru, 2016-07-08 02:16:57

How to switch between activations with the destruction of the first one?

what needs to be attributed so that when switching to another activity, the first one goes to another world.
otherwise launch 2 activations (one after the other), and when you press the Back button several times, I watch everything in reverse order

@Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.button2:
                Intent intent = new Intent(this, Korzina.class);
                startActivity(intent);
                break;
            case R.id.button:
                Intent intentcold = new Intent(this, Cold.class);
                startActivity(intentcold);
                break;
            default:
                break;

        }
    }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DivelNick, 2016-07-08
@DivelNick

You can just add android:noHistory="true" in the manifest if the Activity is always deleted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question