androidextendsoncreatemapactivity

Android studio cannot resolve mapActivity


I am trying to input source code from codly.io which enables me to convert PSD designs into java source.

However, once imported and after fixing issues with appcompact and google play service, I get an error saying it cannot resolve MapActivity.

or during the super.onCreate it cannot resolve the method.

public class Login extends MapActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.view_login);
    initView();
}

private void initView(){



    //TODO add extra view initialization code here
}


@Override
protected boolean isRouteDisplayed() {
    return false;
}


public void onLoginClicked(View v){
    Intent intent = new Intent(this, DriverSelect.class);
    startActivity(intent);
}

public void onBpClicked(View v){
    this.finish();
}

}

Solution

  • it cannot resolve MapActivity

    MapActivity is from the old, defunct MapsV1 way of integrating Google Maps. Since you cannot get API keys for MapsV1 anymore, you will need to modify your code to use MapsV2.

    This also does not speak well for that service, as to how much they are paying attention to their Android code generation, given that MapsV1 was deprecated 1.5 years ago.