I have made a simple Android-UI. Actually I started with the spinner. The button I added only for counterchecking, after the spinner didn't work.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Spinner
android:id="@+id/spinner2"
android:layout_width="409dp"
android:layout_height="wrap_content"
android:layout_marginTop="68dp"
android:entries="@array/months"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/testButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="156dp"
android:text="Test ..."
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spinner2" />
</androidx.constraintlayout.widget.ConstraintLayout>
MainActivity.kt
package com.mizech.playground
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
testButton.setOnClickListener {
Toast.makeText(this, "Testing 123 ...", Toast.LENGTH_LONG).show();
}
}
}
The strings.xml (although I think it isn't relevant):
<resources>
<string name="app_name">Playground</string>
<string-array name="months">
<item>January</item>
<item>February</item>
<item>March</item>
<item>April</item>
<item>May</item>
<item>June</item>
<item>July</item>
<item>August</item>
<item>September</item>
</string-array>
</resources>
The emulator is like frozen. Neither the spinner nor the button react to any interaction.
On a physical device all is fine. The spinner expands it's list when clicked. The button works as well.
What can be the cause, that the emulator behaves suddenly that way? How can it be fixed?
I have used this virtual device for some time. The described problems came out of the sudden.
