简体   繁体   中英

how do call a class(mapview extending mapActivity) from another class?

I tried doing it by using Intent,but,i seem to get the following error: 11-15 22:40:39.266: ERROR/dalvikvm(1589): Could not find class 'BlobCity.xyz.com.maps', referenced from method BlobCity.xyz.com.BlobCity$sendUserPass.onClick

where blobcity is my class that calls the maps class which contains the mapview.

This looks like a classloading or similar issue. It seems to be saying that one compiled Java class ("BlobCity.xyz.com.BlobCity.sendUserPass") contains a static dependency on another class ("BlobCity.xyz.com.maps"), but the class loader (or something) couldn't find the class file for the latter class.

(By the way, your choice of class and package names is pretty awful. You should try to stick to the standard naming conventions if you want other people to be able to understand your code.

  • All class names ... including nested class names should be in "CamelCase".
  • Package names should be all lowercase.
  • Hierarchical package names should in reverse domain name order; eg "com.xyz.blobcity".
  • You shouldn't use a random domain name without some kind of permission / authorization ... and there's no way that I'll believe that you work for "xyz.com"!)

Try using :

<application ...>
    <uses-library android:name="com.google.android.maps" />
    ...
    ...
</application>

in your AndroidManifest.xml, I have the same problem before and adding <uses-library android:name="com.google.android.maps" /> solve the problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM