未找到类异常

时间:2011-03-01 08:26:56

标签: android exception google-maps

在我的Android应用程序中,我使用了谷歌地图。我使用的是Android设备1.6。这个应用程序将完美运行在模拟器和android2.2设备上。当我在Android 1.6中使用此应用程序时,它显示异常

抛出java.lang.ClassNotFoundException

请发送解决方案。

<com.google.android.maps.MapView
android:id="@+id/mMapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="0Ch_WE9h_nEOXJcdEm1UmEVnZjFsenqLslkrGyA"
/>

它在super.onCreate(savedInstanceState)上显示错误;这一行

这是我点击地图的点击事件。

mListView.setOnItemClickListener(new OnItemClickListener()
        {
            public void onItemClick(AdapterView<?> parent, View v,
                    int position, long id)
            {
                ParsedData o = Retailerdata.get(position);

                Intent intenRetailerLocation = new Intent(
                        RetailerListing.this, RetailerLocation.class);
                intenRetailerLocation.putExtra("Lat", Float.valueOf(o
                        .getLat()));
                intenRetailerLocation.putExtra("long", Float.valueOf(o
                        .getLong()));
                intenRetailerLocation.putExtra("Adress", o.getAddress());
                intenRetailerLocation.putExtra("zip", o.getZip());
                intenRetailerLocation.putExtra("city", o.getCity());
                intenRetailerLocation.putExtra("Description", o
                        .getDescription());
                startActivity(intenRetailerLocation);
                finish();

            }

        });

使用谷歌地图的类

@Override
public void onCreate(Bundle savedInstanceState) 
{ 
    super.onCreate(savedInstanceState);// Error comes on this line      
        setContentView(R.layout.retailerlocation);

        myLayout=(RelativeLayout)findViewById(R.id.MyLayout);
        mImageView = (ImageView) findViewById(R.id.picture);
        mContainer = (ViewGroup) findViewById(R.id.container);

    topTitle=(TextView)findViewById(R.id.SelectedGameName);
    mMapView = (MapView) findViewById(R.id.mMapView);
    mMapView.setTraffic(false);
    mMapView.setStreetView(false); 
    mMapView.setSatellite(false);

    mMapView.setBuiltInZoomControls(true);

1 个答案:

答案 0 :(得分:1)

确保您使用Google地图的活动扩展了com.google.android.maps.MapActivity