1 package com.android.calculator2; 2 3 import android.app.Activity; 4 import android.os.Bundle; 5 import android.view.MenuItem; 6 import android.webkit.WebView; 7 8 public class Licenses extends Activity { 9 10 private static final String LICENSE_URL = "file:///android_asset/licenses.html"; 11 12 @Override onCreate(Bundle savedInstanceState)13 protected void onCreate(Bundle savedInstanceState) { 14 super.onCreate(savedInstanceState); 15 16 final WebView webView = new WebView(this); 17 webView.loadUrl(LICENSE_URL); 18 19 setContentView(webView); 20 } 21 22 @Override onOptionsItemSelected(MenuItem item)23 public boolean onOptionsItemSelected(MenuItem item) { 24 if (item.getItemId() == android.R.id.home) { 25 onBackPressed(); 26 return true; 27 } 28 return super.onOptionsItemSelected(item); 29 } 30 } 31