2

I tried to use MapActivity as tab but I always got an exception:

Generates Could not find class exception. when tried to create

Intent mapTabIntent = new Intent(this, MapMF.class);

Why I got an exception? As I analysed the rows of LogCat I realized a message with orange color : Unable to resolve superclass of com....MapMF.class where the class MapMF extends MapActivity of mapsforge.

What did I do wrong?

If I use

com.google.android.maps.MapActivity

instead of

org.mapsforge.android.maps.MapActivity

it works perfectly.

I don't understand why didn't work with MapActivity of mmapsforge. Have somebody got any idea for resolve this problem?

cjds
  • 8,268
  • 10
  • 49
  • 84
L. Kvri
  • 1,456
  • 4
  • 23
  • 41

2 Answers2

0

What's the problem?

This is a perfectly logical conclusion.

com.google.android.maps.MapActivity is the package required to be importde

https://developers.google.com/maps/documentation/android/v1/reference/com/google/android/maps/MapActivity

Check out the Google Sample for a MapActivity. It also imports this

cjds
  • 8,268
  • 10
  • 49
  • 84
  • The problem is, with org.mapsforge.android.maps.MapActivity as Tab page didn't work at all. I would like to implement an off-line map to my app. – L. Kvri Dec 28 '12 at 15:37
  • Of course the MapMF class imported. The exact exception is java.lang.NoClassDefFoundError: com.....map.MapMF If I add full namespace path for example com.myapp.mobile.appname.map.MapMF to each place where I use this class when tried to create intent I got same exception – L. Kvri Dec 28 '12 at 20:05
0

The cause of this problem was, a wrong order of libraries on Properties\Java Build Path\Order and Export. I moved up the mapsforge library, to position below to my application and above the Google APIs [Android 2.2]

L. Kvri
  • 1,456
  • 4
  • 23
  • 41