Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7624201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:54:04+00:00 2026-05-31T04:54:04+00:00

I need to make some changes to two methods in MapView so I’ve done

  • 0

I need to make some changes to two methods in MapView so I’ve done a class that extends it. When I’m trying to use this class the app crashes and with the Log: Unable to start activity.

GameMapActivity: java.lang.ClassCastException: com.google.android.maps.MapView cannot be cast to com.lemonbyte.games.lbg.mapViewC

Because of mapViewC mapView = (mapViewC) findViewById(R.id.mapview);
My class is below
public class mapViewC extends MapView{

public mapViewC(android.content.Context context, android.util.AttributeSet attrs){
    super(context,attrs);
}

 public mapViewC(Context context, String apiKey)
    {
        super(context, apiKey);

    }

public mapViewC(Context context, AttributeSet attrs, int defStyle)
{
    super(context, attrs, defStyle);

}

@Override
public void dispatchDraw(Canvas canvas) {

    //limit zoom level 
    if(getZoomLevel() >15){
        getController().setZoom(15);
        getController().setCenter(new GeoPoint(0, 0));
        //dont draw as it will just be blank and then jump
        return;
    }

    super.dispatchDraw(canvas);
}

}

What am I doing wrong? 🙂 thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:54:06+00:00Added an answer on May 31, 2026 at 4:54 am

    Rename your MapView element in your layout xml as com.lemonbyte.games.lbg.mapViewC (also, as a standard, classes are named with an upper-case first letter).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make some changes to an old Oracle stored procedure on an
I am C++ programmer and I need to make some changes to VB6 code.
I need to download file from FTP server and make some changes on it
I need to make use of some OWL ontologies in c#. Does anyone have
I'm trying to use the methods of class as the django-celery tasks, marking it
I'm using some classes and several utility methods that use std:: vector. Now I
I need to make some reflective method calls in Java. Those calls will include
I need to make some code to talk to a SOAP web service. Unfortunately
I need to make some commits using Git but I would like the timestamp
In a .NET 3.0 project, I need to make some calls via P/Invoke (specifically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.