简体   繁体   中英

Override ClassNames function without Creating new class that extends ClassName

So basically I'm using MyLocationOverlay to draw the users location on the map. However, I do not like how it is drawn. I want to have my own icon and remove the circle around the location.

The only way I know how to do this would be to create a new class that extends MyLocationOverlay and then @Override the draw() function (or whatever it is called).

So, is there anyway to do this without making the new class (and "all" of the boilerplate that is needed)?

So, is there anyway to do this without making the new class (and "all" of the boilerplate that is needed)?

Short of modifying the Android source code, no.

I found out how >.<

ClassName blah = new ClassName() {
    @Override
    function() {}
};

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