Fixed crashes related to attaching and detaching surface
Signed-off-by: Priyank Shankar <shankarpriyank312002@gmail.com>
This commit is contained in:
parent
a99f08c03a
commit
689f500a01
2 changed files with 14 additions and 3 deletions
|
@ -69,9 +69,14 @@ public class HelloWorldScreen extends Screen implements SurfaceCallback
|
|||
Action zoomOut = new Action.Builder().setIcon(new CarIcon.Builder(IconCompat.createWithResource(getCarContext(), R.drawable.ic_zoom_out)).build())
|
||||
.setOnClickListener(this::zoomOut)
|
||||
.build();
|
||||
|
||||
Action openMic = new Action.Builder().setIcon(new CarIcon.Builder(IconCompat.createWithResource(getCarContext(), R.drawable.ic_booking)).build())
|
||||
.setOnClickListener(this::zoomOut)
|
||||
.build();
|
||||
|
||||
ActionStrip mapActionStrip = new ActionStrip.Builder().addAction(zoomIn)
|
||||
.addAction(zoomOut)
|
||||
.addAction(panAction)
|
||||
.addAction(panAction).addAction(openMic)
|
||||
.build();
|
||||
builder.setMapActionStrip(mapActionStrip);
|
||||
builder.setActionStrip(actionStripBuilder.build());
|
||||
|
@ -108,7 +113,11 @@ public class HelloWorldScreen extends Screen implements SurfaceCallback
|
|||
}
|
||||
|
||||
|
||||
MapFragment.nativeDetachSurface(true);
|
||||
|
||||
if (MapFragment.nativeIsEngineCreated()){
|
||||
MapFragment.nativeDetachSurface(true);
|
||||
}
|
||||
|
||||
|
||||
if (MapFragment.nativeIsEngineCreated())
|
||||
{
|
||||
|
|
|
@ -153,7 +153,9 @@ public class MapFragment extends BaseMwmFragment
|
|||
|
||||
@Override
|
||||
public void surfaceCreated(SurfaceHolder surfaceHolder)
|
||||
{
|
||||
{ if(nativeIsEngineCreated()){
|
||||
nativeDetachSurface(true);
|
||||
}
|
||||
|
||||
if (isThemeChangingProcess())
|
||||
{
|
||||
|
|
Reference in a new issue