Android findViewByID突然返回null

Android findViewByID突然返回null,android,google-maps-api-3,Android,Google Maps Api 3,在我把我的问题发布到这里之前,我已经做了一些研究,但是没有一个对我有帮助。奇怪的是,它昨晚起作用了,我相信什么都没有改变。但是,我现在无法让它工作,因为findViewByID毫无理由返回null public class ShowInMap extends MapActivity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setConten

在我把我的问题发布到这里之前,我已经做了一些研究,但是没有一个对我有帮助。奇怪的是,它昨晚起作用了,我相信什么都没有改变。但是,我现在无法让它工作,因为findViewByID毫无理由返回null

    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");
    } 
    }
}
这是我的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"
/>


我在想也许我的调试密钥已经过期了,但如果是这样的话,我应该从Eclipse中得到一些错误,说我的密钥过期了还是什么?我不应该吗?这有点令人沮丧,任何评论都将不胜感激。谢谢

尝试清理生成。这种事时常发生在我身上。通常情况下,如果我只是清理构建,然后进行完整的重建,事情似乎会顺利进行。

我认为api密钥没有问题。如果有,它会显示在地图上,但会显示白色的瓷砖。非常感谢你!它只是起作用了!我不知道为什么,也不想知道。2个小时的挖掘让我发疯。真的很感激