Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old June 26th, 2010, 06:43 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jun 2010
Posts: 12
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Launch MapActivity from regular Activity

I'm trying to launch a MapActivity Class from an Activity Class.
Here's the Errors I'm seeing in LogCat when I'm starting up the app - the app doesn't actually crash until I click the button to launch the MapActivity. I read where one person had this problem that turned out to be caused by using an emulator version that didn't match the app target version, but I verified that the emulator does match the target version.

06-26 23:37:56.628: WARN/dalvikvm(287): Unable to resolve superclass of Lcom/ripleyapp/FindUs; (30)
06-26 23:37:56.638: WARN/dalvikvm(287): Link of class 'Lcom/ripleyapp/FindUs;' failed
06-26 23:37:56.648: ERROR/dalvikvm(287): Could not find class 'com.ripleyapp.FindUs', referenced from method com.ripleyapp.ripleyapp.startGPS

Here's the referenced startGPS method:

privatevoid startGPS(){

final Intent intent = new Intent(ripleyapp.this, FindUs.class);
startActivity(intent);
}

Advertisements
kryten is offline  
Reply With Quote
sponsored links
Old June 26th, 2010, 07:38 PM   #2 (permalink)
Junior Member
 
Join Date: Apr 2010
Location: Salt Lake City, UT
Posts: 44
 
Device(s): Motorola Droid
Carrier: Not Provided

Thanks: 1
Thanked 10 Times in 9 Posts
Default

Try referencing the class in the Intent constructor using its fully qualified name or at least make sure that the namespace is correct. It looks like the class you're trying to launch (i.e. FindUs) can't be located.
dmitriyk is offline  
Reply With Quote
Old June 27th, 2010, 04:31 PM   #3 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jun 2010
Posts: 12
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Sounded plausible

Quote:
Originally Posted by dmitriyk View Post
Try referencing the class in the Intent constructor using its fully qualified name or at least make sure that the namespace is correct. It looks like the class you're trying to launch (i.e. FindUs) can't be located.

Just tried that, but still...

final Intent intent = new Intent(ripleyapp.this, com.ripleyapp.FindUs.class);

06-27 21:16:02.466: WARN/dalvikvm(285): Unable to resolve superclass of Lcom/ripleyapp/FindUs; (30)
06-27 21:16:02.476: WARN/dalvikvm(285): Link of class 'Lcom/ripleyapp/FindUs;' failed
06-27 21:16:02.476: ERROR/dalvikvm(285): Could not find class 'com.ripleyapp.FindUs', referenced from method com.ripleyapp.ripleyapp.startGPS
06-27 21:16:02.496: WARN/dalvikvm(285): VFY: unable to resolve const-class 35 (Lcom/ripleyapp/FindUs in Lcom/ripleyapp/ripleyapp;


Another note - If I change the class so that it extends Activity instead of MapActivity, I don't get that error (but of course, I can't use it to display a map then)
kryten is offline  
Reply With Quote
Old July 17th, 2010, 07:29 AM   #4 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jun 2010
Posts: 12
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found a solution - You simply make that regular activity a mapactivity. That's it. You have to add an unimplemented method along with that of course, but you don't have to actually add a mapview to the layout, just change "extends Activity" to "extends MapActivity". I guess that's why no one has answered the question because the solution is so obvious. I had tried this once and failed, but forgot to put the " <uses-library android:name="com.google.android.maps" />" in the manifest
kryten is offline  
Reply With Quote
Old November 13th, 2010, 10:43 PM   #5 (permalink)
New Member
 
Join Date: Nov 2010
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just move the <uses-library android:name="com.google.android.maps" /> UP int he mainfest file and every think will work fine
dimovdaniel is offline  
Reply With Quote
Reply
Tags
mapactivity


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:41 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.