Fixed crash when pressed back on map in Android version 2.3
This commit is contained in:
parent
5124d01ef5
commit
b47e0d7be2
3 changed files with 15 additions and 7 deletions
7
OsmAnd/res/layout/gl_surface.xml
Normal file
7
OsmAnd/res/layout/gl_surface.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.opengl.GLSurfaceView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/glSurfaceView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
</android.opengl.GLSurfaceView>
|
|
@ -12,11 +12,11 @@
|
|||
android:keepScreenOn="true"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<android.opengl.GLSurfaceView
|
||||
android:id="@+id/glSurfaceView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
<ViewStub android:id="@+id/glSurfaceStub"
|
||||
android:inflatedId="@+id/glSurfaceView"
|
||||
android:layout="@layout/gl_surface"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<net.osmand.plus.views.OsmAndMapSurfaceView
|
||||
android:id="@+id/MapView"
|
||||
|
|
|
@ -68,6 +68,7 @@ import android.view.KeyEvent;
|
|||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.ViewStub;
|
||||
import android.view.Window;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ProgressBar;
|
||||
|
@ -138,8 +139,8 @@ public class MapActivity extends AccessibleActivity {
|
|||
parseLaunchIntentLocation();
|
||||
|
||||
if(settings.USE_NATIVE_RENDER.get() && NativeQtLibrary.isInit()) {
|
||||
glSurfaceView = (GLSurfaceView) findViewById(R.id.glSurfaceView);
|
||||
glSurfaceView.setVisibility(View.VISIBLE);
|
||||
ViewStub stub = (ViewStub) findViewById(R.id.glSurfaceStub);
|
||||
glSurfaceView = (GLSurfaceView) stub.inflate();
|
||||
OsmAndMapLayersView ml = (OsmAndMapLayersView) findViewById(R.id.MapLayersView);
|
||||
ml.setVisibility(View.VISIBLE);
|
||||
NativeQtLibrary.initView(glSurfaceView);
|
||||
|
|
Loading…
Reference in a new issue