All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.tidalwave.bluebill.mobile.android.news.NewsItemActivity Maven / Gradle / Ivy

There is a newer version: 0.15
Show newest version
/***********************************************************************************************************************
 *
 * blueBill Mobile - open source birdwatching
 * ==========================================
 *
 * Copyright (C) 2009, 2010 by Tidalwave s.a.s. (http://www.tidalwave.it)
 * http://bluebill.tidalwave.it/mobile/
 *
 ***********************************************************************************************************************
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 ***********************************************************************************************************************
 *
 * $Id: NewsItemActivity.java,v d808b6cb5d50 2010/07/10 21:19:33 fabrizio $
 *
 **********************************************************************************************************************/
package it.tidalwave.bluebill.mobile.android.news;

import android.content.Intent;
import javax.annotation.Nonnull;
import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import it.tidalwave.bluebill.mobile.android.R;
import it.tidalwave.bluebill.mobile.android.util.CommonOptionsMenuController;
import it.tidalwave.util.logging.Logger;

/***********************************************************************************************************************
 *
 * @author  Fabrizio Giudici
 * @version $Id: $
 *
 **********************************************************************************************************************/
public class NewsItemActivity extends Activity
  {
    private static final String CLASS = NewsItemActivity.class.getName();
    private static final Logger logger = Logger.getLogger(CLASS);

    private final CommonOptionsMenuController commonOptionsMenuController = new CommonOptionsMenuController(this);
    
    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    @Override
    protected void onCreate (final @Nonnull Bundle savedInstanceState)
      {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.news_item_activity);
        final Intent intent = getIntent();
        ((TextView)findViewById(R.id.tvDate)).setText(intent.getExtras().getString("date"));
        ((TextView)findViewById(R.id.tvTitle)).setText(intent.getExtras().getString("title"));
        ((TextView)findViewById(R.id.tvContent)).setText(Html.fromHtml(intent.getExtras().getString("content")));
      }

    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    @Override
    public boolean onCreateOptionsMenu (final @Nonnull Menu menu)
      {
        getMenuInflater().inflate(R.menu.news_options_menu, menu);
        return true;
      }

    /*******************************************************************************************************************
     *
     *
     ******************************************************************************************************************/
    @Override
    public boolean onOptionsItemSelected (final @Nonnull MenuItem item)
      {
        return commonOptionsMenuController.onOptionsItemSelected(item);
      }
  }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy