diff --git a/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/TiltActivity.java b/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/TiltActivity.java index 5ff29fe2280..6e858ea2bc5 100644 --- a/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/TiltActivity.java +++ b/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/TiltActivity.java @@ -1,7 +1,10 @@ package com.mapbox.mapboxsdk.testapp; import android.os.Bundle; +import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.MenuItem; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.constants.Style; @@ -18,6 +21,15 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tilt); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + actionBar.setDisplayShowHomeEnabled(true); + } + // Target LatLng nyc = new LatLng(40.73581, -73.99155); @@ -82,4 +94,15 @@ protected void onSaveInstanceState(Bundle outState) { mMapView.onSaveInstanceState(outState); } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + onBackPressed(); + return true; + default: + return super.onOptionsItemSelected(item); + } + } + } diff --git a/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_tilt.xml b/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_tilt.xml index 2e27fbf0739..c211aea5bc1 100644 --- a/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_tilt.xml +++ b/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_tilt.xml @@ -1,13 +1,19 @@ - + + + - +