- Forum-Beiträge: 55
01.11.2018, 22:33:37 via Website
01.11.2018 22:33:37 via Website
Ich habe ein simples Spiel programmiert, welches bei geschätzt 50% der Android Geräte beim Start abstürzt und bei einigen erst bei der zweiten Activity.
Die App ist ziemlich simpel, ich verstehe nicht, wo das Problem liegen könnte. habe sie auch bereits in den Playstore geladen.
Hier die erste Activity
<?xml version="1.0" encoding="utf-8"?>
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"
android:background="@drawable/clashofpistart"
tools:context=".Menue">
<Button
android:id="@+id/btnGo"
style="@android:style/Widget.Button"
android:layout_width="295dp"
android:layout_height="93dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/buttton"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.506"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.55" />
<Button
android:id="@+id/btnScore"
android:layout_width="100dp"
android:layout_height="93dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/btnleu"
android:text="SCORE"
android:textColor="@android:color/black"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.91"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.043" />
und nun die Java Klasse
package de.apppuls.bilal.clashofpi;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Menue extends AppCompatActivity implements View.OnClickListener {
Button btnGo;
Button btnScore;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menue);
btnGo = (Button) findViewById(R.id.btnGo);
btnGo.setOnClickListener(this);
btnScore = (Button) findViewById(R.id.btnScore);
btnScore.setOnClickListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.btnGo:
Intent intent = new Intent(this, Spiel.class);
startActivity(intent);
this.finish();
break;
case R.id.btnScore:
Intent iZwei = new Intent(this, Ende.class);
startActivity(iZwei);
this.finish();
break;
}
}
}
Die Samsung galaxy s Reihe hat große Probleme mit dem Spiel.
Empfohlener redaktioneller Inhalt
Mit Deiner Zustimmung wird hier ein externer Inhalt geladen.
Mit Klick auf den oben stehenden Button erklärst Du Dich damit einverstanden, dass Dir externe Inhalte angezeigt werden dürfen. Dabei können personenbezogene Daten an Drittanbieter übermittelt werden. Mehr Infos dazu findest Du in unserer Datenschutzerklärung.