before I posted my problem here, I have been done some researches but none of them helps. The weird part is that it worked last night and I believed nothing has been changed at all. However, I can’t make it work now because the findViewByID returns null for no reason
public class ShowInMap extends MapActivity{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapview);
MapView mapView = (MapView) this.findViewById(R.id.mapview);
if(mapView == null)
{
Log.i("test", "test");
}
}
}
and this is my mapview xml
<?xml version="1.0" encoding="utf-8"?>
<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="Map Key"
/>
I am thinking maybe my debug key has expired but if that was the case, I should have gotten some errors from Eclipse saying my key is expired or something? Shouldn’t I? It is a bit frustrating, any comment would be appreciated. Thank you
Try cleaning the build. This happens to me every-now-and-then. Usually if I just clean the build and then to a complete rebuild, things seem to work.