add map option, fixes #11
This commit is contained in:
parent
75ed44811a
commit
bb53b29ece
2 changed files with 11 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ package com.example.hochi.nextcompanion;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
|
@ -85,6 +86,11 @@ public class MainActivity extends AppCompatActivity implements AsyncTaskCallback
|
|||
startActivity(intent);
|
||||
}
|
||||
|
||||
if (id == R.id.action_map) {
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.map_url)));
|
||||
startActivity(browserIntent);
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="com.example.hochi.nextcompanion.MainActivity">
|
||||
<item
|
||||
android:id="@+id/action_map"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/action_logout"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_logout"
|
||||
android:orderInCategory="100"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue