I'm using the following map API to create an app If you try to create and use a method to take a marker, the app keeps turning off.
This is the code.
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, MapView.MapViewEventListener, MapView.POIItemEventListener {
Public static final string API_KEY = "Next Map API"; //Actually use the following API key: I'll cover it here
private BackPressCloseHandler backPressCloseHandler;
private MapView mapView;
MapPoint.GeoCoordinate CurrentLocation;
MapPOIItem mDefaultMarker;
public static final int FINE_PERMISSION = 1000;
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mapView = new MapView(this);
mapView.setDaumMapApiKey(API_KEY);
ViewGroup mapViewContainer = (ViewGroup)findViewById(R.id.container);
mapViewContainer.addView(mapView);
int permissionFine = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION); // Location Permission Variable
checkGPSPermission(permissionFine);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick (View view) {
mapView.setCurrentLocationTrackingMode(MapView.CurrentLocationTrackingMode.TrackingModeOnWithoutHeading); //Get Current Location
}
});
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
backPressCloseHandler = newBackPressCloseHandler (this); //Handler to exit by pressing the Back key twice
CreateDefaultMarker (mapView); // Error when calling this part
}
private void createDefaultMarker(MapView mapView) {
mDefaultMarker = new MapPOIItem();
mDefaultMarker.setItemName("Marker");
mDefaultMarker.setTag(0);
mDefaultMarker.setMapPoint(MapPoint.mapPointWithGeoCoord(126.8439946101, 37.3282802259));
mDefaultMarker.setMarkerType(MapPOIItem.MarkerType.BluePin);
mDefaultMarker.setSelectedMarkerType(MapPOIItem.MarkerType.RedPin);
mapView.addPOIItem(mDefaultMarker);
mapView.selectPOIItem(mDefaultMarker, true);
mapView.setMapCenterPoint(MapPoint.mapPointWithGeoCoord(126.8439946101, 37.3282802259), true);
}
//Omit the rest (bottom part)
The error code is 05-07 23:46:27.785 937-1364/kingofparking.vmffn.com.kingofparking A/libc: Fatal signal 11 (SIGSEGV), code 1, faultaddr 0x0 intid 1364 (GLThread 48521)
It pops up like this, but when I googled it, it says it's because I referred to the wrong address, but I don't know why.
I brought the createDefaultMarker
method of creating a marker among the codes in the following map sample SDK, but there is an error.
Adding android:hardwareAccelerated="false"
to P.S Manifest does not solve it
May I know the following map sample SDK link you are referring to? The error you uploaded is the log that was output when an error occurred in the JNI code of the following map library. Therefore, it is difficult to find problems with Java code. The guess is that the part that needs to be initialized is not initialized or the order of calling the API is wrong.
If you tell me the following map sample SDK for reference, I think I can compare it with the code you posted. It is also necessary to check if the sample code you are referring to actually works well. Make sure your library is up to date. For your information, there was no particular problem when printing the next map API.
544 Unable to install versioned in Google Colab
549 Understanding How to Configure Google API Key
549 Who developed the "avformat-59.dll" that comes with FFmpeg?
551 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
543 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.