Android Open Source - timestatistic Topic Activity






From Project

Back to project page timestatistic.

License

The source code is released under:

GNU General Public License

If you think the Android project timestatistic listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package maximsblog.blogspot.com.timestatistic;
//from w  w  w .ja  v  a 2s.  com
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

import maximsblog.blogspot.com.timestatistic.R.drawable;
import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Html;
import android.text.Html.ImageGetter;
import android.text.method.LinkMovementMethod;
import android.widget.TextView;

public class TopicActivity extends Activity {

  int mTextResourceId = 0;
  private AdView adView;

  /**
   * onCreate
   * 
   * @param savedInstanceState
   *            Bundle
   */

  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_topic);

    // Read the arguments from the Intent object.
    Intent in = getIntent();
    mTextResourceId = in.getIntExtra(HelpActivity.ARG_TEXT_ID, 0);
    if (mTextResourceId <= 0)
      mTextResourceId = R.string.no_help_available;
    setTitle(getString(R.string.help) + ": "
        + in.getStringExtra(HelpActivity.ARG_TITLE));
    TextView textView = (TextView) findViewById(R.id.topic_text);
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    textView.setText(Html.fromHtml(getString(mTextResourceId),
        this.imgGetter, null));
    adView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder()
        .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
        .addTestDevice("CF95DC53F383F9A836FD749F3EF439CD").build();
    adView.loadAd(adRequest);
  }

  private ImageGetter imgGetter = new ImageGetter() {

    @Override
    public Drawable getDrawable(String source) {
      Drawable img = null;
      if (source.equals("hlp_main_act")) {
        img = (Drawable) getResources().getDrawable(
            R.drawable.hlp_main_act);
      } else if (source.equals("hlp_cutting_rec")) {
        img = (Drawable) getResources().getDrawable(
            R.drawable.hlp_cutting_rec);
      } else if (source.equals("hlp_edit_rec")) {
        img = (Drawable) getResources().getDrawable(
            R.drawable.hlp_edit_rec);
      } else if (source.equals("hlp_union_rec")) {
        img = (Drawable) getResources().getDrawable(
            R.drawable.hlp_union_rec);
      } else if (source.equals("hlp_union_dlg")) {
        img = (Drawable) getResources().getDrawable(
            R.drawable.hlp_union_dlg);
      }
      img.setBounds(0, 0, img.getIntrinsicWidth(),
          img.getIntrinsicHeight());
      return img;
    }
  };

  @Override
  protected void onResume() {
    super.onResume();
    adView.resume();
  }

  @Override
  protected void onPause() {
    adView.pause();
    super.onPause();
  }

  @Override
  protected void onDestroy() {
    adView.destroy();
    super.onDestroy();
  };
} // end class





Java Source Code List

maximsblog.blogspot.com.timestatistic.AboutActivity.java
maximsblog.blogspot.com.timestatistic.AboutFragment.java
maximsblog.blogspot.com.timestatistic.AlarmManagerBroadcastReceiver.java
maximsblog.blogspot.com.timestatistic.AreYouSureResetAllDialogFragment.java
maximsblog.blogspot.com.timestatistic.AreYouSureResetAllDialog.java
maximsblog.blogspot.com.timestatistic.BootUpReceiver.java
maximsblog.blogspot.com.timestatistic.CalendarSetupDialogFragment.java
maximsblog.blogspot.com.timestatistic.ColorPickerDialogFragment.java
maximsblog.blogspot.com.timestatistic.ColorPickerDialog.java
maximsblog.blogspot.com.timestatistic.CounterEditorDialogFragment.java
maximsblog.blogspot.com.timestatistic.CountersCursorAdapter.java
maximsblog.blogspot.com.timestatistic.CountersFragment.java
maximsblog.blogspot.com.timestatistic.CountersPeriodSetupDialogFragment.java
maximsblog.blogspot.com.timestatistic.CustomDateTimePicker.java
maximsblog.blogspot.com.timestatistic.DiagramFragment.java
maximsblog.blogspot.com.timestatistic.DiaryCursorAdapter.java
maximsblog.blogspot.com.timestatistic.DiaryEditorDialogFragment.java
maximsblog.blogspot.com.timestatistic.DiaryFragment.java
maximsblog.blogspot.com.timestatistic.ExportImportBackupActivity.java
maximsblog.blogspot.com.timestatistic.ExportToCSVActivity.java
maximsblog.blogspot.com.timestatistic.ExportToCSVService.java
maximsblog.blogspot.com.timestatistic.ExportToGoogleCalendarActivity.java
maximsblog.blogspot.com.timestatistic.ExportToGoogleCalendarService.java
maximsblog.blogspot.com.timestatistic.FileDialog.java
maximsblog.blogspot.com.timestatistic.FilterDateOption.java
maximsblog.blogspot.com.timestatistic.FilterDateSetDialogFragment.java
maximsblog.blogspot.com.timestatistic.FilterDialogFragment.java
maximsblog.blogspot.com.timestatistic.GdriveUpload.java
maximsblog.blogspot.com.timestatistic.HelpActivity.java
maximsblog.blogspot.com.timestatistic.HistoryFragment.java
maximsblog.blogspot.com.timestatistic.ICustomDateTimeListener.java
maximsblog.blogspot.com.timestatistic.IRecordDialog.java
maximsblog.blogspot.com.timestatistic.IdateChange.java
maximsblog.blogspot.com.timestatistic.Item.java
maximsblog.blogspot.com.timestatistic.MainActivity.java
maximsblog.blogspot.com.timestatistic.OpenHelper.java
maximsblog.blogspot.com.timestatistic.PeriodAnalyseActivity.java
maximsblog.blogspot.com.timestatistic.PeriodAnalyseFragment.java
maximsblog.blogspot.com.timestatistic.PeriodData.java
maximsblog.blogspot.com.timestatistic.PeriodSetupDialogFragment.java
maximsblog.blogspot.com.timestatistic.RecordsDbHelper.java
maximsblog.blogspot.com.timestatistic.SelectionMode.java
maximsblog.blogspot.com.timestatistic.SettingsActivity.java
maximsblog.blogspot.com.timestatistic.SplitRecordDialogFragment.java
maximsblog.blogspot.com.timestatistic.TimeRecordsFragment.java
maximsblog.blogspot.com.timestatistic.TimesCursorAdapter.java
maximsblog.blogspot.com.timestatistic.TopicActivity.java
maximsblog.blogspot.com.timestatistic.UnionRecordDialogFragment.java
maximsblog.blogspot.com.timestatistic.XYMultipleSeriesDatasetLoader.java
maximsblog.blogspot.com.timestatistic.app.java