Ok Thema hat sich erledigt, ich hab vergessen der Methode "final View view" zu übergeben^^
Beiträge von krypto88
-
-
Hallo Community,
das ist mein erster Beitrag und hoffe, dass Ihr mir helfen könnt.
Habe die Suchfunktion ausprobiert, aber da habe ich auch nichts dazu gefunden.Also zu meiner App:
Ich habe da eigentlich nichts dahinter gedacht, da ich erst seit kurzem mit Android programmiere.
Ich will zuerst die Möglichkeiten durchcoden, wie z.b. mit einer MySql Datenbank online anzubinden, was auch alles sehr gut gelungen ist.Nun aber mein Fehler:
Wenn ich die Google Maps anzeigen will klappt das mit meiner Mainklasse einwandfrei (A2LGoogleActivity), der Key wird erkannt die Google Maps werden angezeigt.
Mach ich aber eine OnClick option in der XML wo ich sage, dass eine neue Klasse dabei aufgerufen wird und dort dann die Google Maps anzeigt werden sollen, dann stürzt die App abNun meine Frage, ob ihr da den Schweinehund im Code eventuell erkennen könnt.
Meine Main(A2LGoogleActivity), bei der funktionieren die Google Maps
Java
Alles anzeigenpublic class A2LGoogleActivity extends MapActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void start(){ Intent intent = new Intent(this,LoginArea.class); startActivity(intent); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } }
Java
Alles anzeigenpublic class LoginArea extends MapActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.loginarea); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } }
Code
Alles anzeigen<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:onClick="start" /> </LinearLayout>
Code
Alles anzeigen<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:onClick="start" /> <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="**************************" /> </LinearLayout>
Ich denk mal nicht, dass es an den .XML Dateien hängen kann, da wie gesagt in der Main es ganz normal funktioniert.
Hoffe Ihr könnt mir da weiterhelfen
Grüße
Alex