Skip to content
Snippets Groups Projects
Commit 8dceb159 authored by Maxime Graulich's avatar Maxime Graulich
Browse files

Android: add back button to About Activity

parent d15f9c7e
No related branches found
No related tags found
No related merge requests found
......@@ -3,12 +3,15 @@ package org.geuz.onelab;
import java.lang.String;
import android.app.Activity;
import android.content.Intent;
import android.view.MenuItem;
import android.webkit.WebView;
public class AboutActivity extends Activity{
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setDisplayHomeAsUpEnabled(true);
WebView webview = new WebView(this);
String aboutGmsh = Gmsh.getAboutGmsh();
String aboutGetDP = Gmsh.getAboutGetDP();
......@@ -24,5 +27,13 @@ public class AboutActivity extends Activity{
webview.loadDataWithBaseURL("", aboutOnelab + aboutGmsh + aboutGetDP, "text/html", "UTF-8", "");
setContentView(webview);
}
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
if(item.getItemId() == android.R.id.home) {
Intent returnIntent = new Intent();
this.setResult(RESULT_CANCELED, returnIntent);
this.finish();
}
return super.onMenuItemSelected(featureId, item);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment