Hi all,
could you give me some help please? I have written a simple
MapActivity that contains a mapview (defined in the xml file); it also
contains a Button.
If the Button has no OnClickListener associated then the project runs
fine (the mapview is of course empty).
If I add an OnclickListener the application simply Force closes.
Has anyone tried this? I was actually following the example in a book
but I guess something has changed in the SDK since it was written?
I did also remember to add the permissions (INTERNET, COARSE LOC and
FINE LOC) and the uses-library too as per documentation.
I m using SDK 1.1 (for the moment).
If you have (recently) written something similar, could you give me
some pointers please?
Here is my java class:

package com.chipset.testgps;

import com.google.android.maps.MapView;
import android.widget.Button;
import com.google.android.maps.MapActivity;
import android.os.Bundle;

public class main extends MapActivity {
@Override
public boolean isRouteDisplayed(){
return false;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Button but = (Button) findViewById(R.id.gpsButton);

// but.setOnClickListener(new View.OnClickListener() {
// public void onClick(View v){
//
// }
// });

final MapView map = (MapView) findViewById(R.id.myMap);
setContentView(R.layout.main);
}
}





thanks
N

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to