Hallo Community,
Ich befasse mich neuerdings mit der Android-Programmierung mit Eclipse. Nun war mein erstes Ziel, einen Mini-Rechner zu programmieren. Man sollte einfach nur eine Zahl eingeben können, dann auf einen Button, welcher in ein TextView die Zahl zum Quadrat anzeigt, oder einen Button, welcher die Wurzel der eingegebenen Zahl anzeigt, klicken können.
Jetzt habe ich das Layout mit XML fertig, habe den Emulator gestartet ich habe das Programm gestartet, aber es ist nichts passiert. Es gab zwar keinen Fehler, aber mein Layout wurde auch nicht angezeigt.
Kann mir vlt einer helfen und mir sagen, was ich falsch mache!
Danke schon im vorraus
[XML]<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
androidrientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="1">
<TextView android:id="@+id/textView1" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/h1"></TextView>
<TextView android:text="@string/enter" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="number">
<requestFocus></requestFocus>
</EditText>
<LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:weightSum="1">
<Button android:text="Button" android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="160dp"></Button>
<Button android:text="Button" android:id="@+id/button2" android:layout_height="wrap_content" android:layout_width="160dp"></Button>
</LinearLayout>
</LinearLayout>
[/XML]
Ich befasse mich neuerdings mit der Android-Programmierung mit Eclipse. Nun war mein erstes Ziel, einen Mini-Rechner zu programmieren. Man sollte einfach nur eine Zahl eingeben können, dann auf einen Button, welcher in ein TextView die Zahl zum Quadrat anzeigt, oder einen Button, welcher die Wurzel der eingegebenen Zahl anzeigt, klicken können.
Jetzt habe ich das Layout mit XML fertig, habe den Emulator gestartet ich habe das Programm gestartet, aber es ist nichts passiert. Es gab zwar keinen Fehler, aber mein Layout wurde auch nicht angezeigt.
Kann mir vlt einer helfen und mir sagen, was ich falsch mache!
Danke schon im vorraus
[XML]<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
androidrientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="1">
<TextView android:id="@+id/textView1" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/h1"></TextView>
<TextView android:text="@string/enter" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="number">
<requestFocus></requestFocus>
</EditText>
<LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:weightSum="1">
<Button android:text="Button" android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="160dp"></Button>
<Button android:text="Button" android:id="@+id/button2" android:layout_height="wrap_content" android:layout_width="160dp"></Button>
</LinearLayout>
</LinearLayout>
[/XML]