A
A
Alex Ivanov2016-10-14 04:35:41
Java
Alex Ivanov, 2016-10-14 04:35:41

How to save the screen when rotating?

I'm trying to write a simple application for myself for android.
I ran into a problem - when you click on the button, the Activity changes - the transition to the list of items I need. Everything would be fine, but when you rotate the screen, everything returns to the first screen. How can this be fixed?
This is how I have the transition to another Activity
Button

<Button
        android:text="Перейти к разделам"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/Brazdel"
        android:textAllCaps="false"
        android:onClick="AllRazdel"
        android:layout_below="@+id/textView"
        android:layout_centerHorizontal="true" />

JAVA
public void AllRazdel(View view) {
        // действия, совершаемые после нажатия на кнопку
        setContentView(R.layout.razdely);
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rou1997, 2016-10-14
@Protossan

This is not a transition to another Activity, the transition is implemented through Intent, redo it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question