I am making an app in which i am using google map and my code snippet foe main xml is as follows:
<com.google.android.maps.MapView
android:id="@+id/mapview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:apiKey="0lr6nShkIg955xnYpmUOgPpsSuEJctwQIUXExhw"
android:clickable="true"
android:enabled="true" >
</com.google.android.maps.MapView>
and my java code is:
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class MapList extends MapActivity {
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
System.out.println("hello1");
super.onCreate(savedInstanceState);
System.out.println("hello");
setContentView(R.layout.main);
}
}
and android manifest is:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-library android:name="com.google.android.maps" />
but on compile time it gives me exception:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.trigma.map/com.trigma.map.MapList}: java.lang.ClassNotFoundException: com.trigma.map.MapList in loader dalvik.system.PathClassLoader[/data/app/com.trigma.map-1.apk].
Can anyone help me how to solve this?
As you said you have written this but Have you defined this line
<uses-library android:name="com.google.android.maps" />in between the
<application> here </application>Tag?Yesterday i did the same mistake,so just asking to check.