You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
Hello, I hope you can understand I speak Spanish and I had to help myself with a translator. It turns out that I want to load a mapFragment by means of a button, which is good for me the first time, it is loaded, but when I fly to hit the button with the map already loaded or it bounces me and or it paralyzes the sight that no longer lets me move in the map. I leave the code to have if they help me. The same happens to me when I want to work with a navigationdrawer.
boton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (savedInstanceState == null) {
// Create fragment
final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
LatLng patagonia = new LatLng(-52.6885, -70.1395);
// Build mapboxMap
MapboxMapOptions options = new MapboxMapOptions();
options.styleUrl(Style.SATELLITE);
options.camera(new CameraPosition.Builder()
.target(patagonia)
.zoom(9)
.build());
// Create map fragment
mapFragment = SupportMapFragment.newInstance(options);
// Add map fragment to parent container
transaction.add(R.id.fragment_contenedor, mapFragment, "com.mapbox.map");
transaction.commit();
} else {
mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentByTag("com.mapbox.map");
}
mapFragment.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(MapboxMap mapboxMap) {
// Customize map with markers, polylines, etc.
}
});
}
});
}
}
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.Bundle.getBoolean(java.lang.String, boolean)' on a null object reference
at com.mapbox.mapboxsdk.storage.FileSource.getCachePath(FileSource.java:88)
at com.mapbox.mapboxsdk.storage.FileSource$FileDirsPathsTask.doInBackground(FileSource.java:165)
at com.mapbox.mapboxsdk.storage.FileSource$FileDirsPathsTask.doInBackground(FileSource.java:155)
at android.os.AsyncTask$2.call(AsyncTask.java)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
The text was updated successfully, but these errors were encountered:
@quimico99 I copied over your code and not able to reproduce your issue.
The exception shown is expected and we removed logging of it in #13102. Would you be able to try reproducing this issue with v6.6.1?
I was able to solve my problem. And it is that I structure my code badly. Another problem that I corrected is that the fragmentTransaction put it out of the onclicklistener and I skip another error by repetition of the commit. This is corrected by entering it into the ONCLICKlistener.
public class MainActivity extends AppCompatActivity {
Bundle checkea;
Hello, I hope you can understand I speak Spanish and I had to help myself with a translator. It turns out that I want to load a mapFragment by means of a button, which is good for me the first time, it is loaded, but when I fly to hit the button with the map already loaded or it bounces me and or it paralyzes the sight that no longer lets me move in the map. I leave the code to have if they help me. The same happens to me when I want to work with a navigationdrawer.
Configuration
Android versions: 5.0
Device models:MEMU, HTC M7
Mapbox SDK versions:6.5.0
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import com.mapbox.mapboxsdk.Mapbox;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.constants.Style;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.MapboxMapOptions;
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
import com.mapbox.mapboxsdk.maps.SupportMapFragment;
public class MainActivity extends AppCompatActivity {
// Create supportMapFragment
}
The text was updated successfully, but these errors were encountered: