

package fme.common;

import android.app.ActionBar;
import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import android.webkit.WebView;

public class TopicDetails extends Activity {

   private static final String TAG_DESC = "description";

   private String description;

   @Override
   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

      ActionBar actionBar = getActionBar();
      actionBar.setDisplayHomeAsUpEnabled(true);

      description = this.getIntent().getExtras().getString(TAG_DESC);
      WebView webview = new WebView(getApplicationContext());
      webview.loadData(description, "text/html", null);
      setContentView(webview);
   }

   @Override
   public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
      case android.R.id.home:
         return SettingsMenu.backToHome(getBaseContext());
      }
      return false;
   }

}
