Android Open Source - personal-diary Go Pro Activity






From Project

Back to project page personal-diary.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project personal-diary 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 com.rahul.pDiary;
//from ww  w  .j a  va  2 s .com
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;

public class GoProActivity extends Activity {
  private static final String TAG = "GoProActivity";
  Button getIt, noThanks;
  CheckBox dontRemind;
  Context context;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    if(DiaryApp.isThemeDark()) setTheme(android.R.style.Theme_DeviceDefault);
    else setTheme(android.R.style.Theme_DeviceDefault_Light);
    
    super.onCreate(savedInstanceState);
    setContentView(R.layout.go_pro_activity);
    context = getBaseContext();

    Log.d(TAG, "came in");

    getIt = (Button) findViewById(R.id.get_it_now_button);
    noThanks = (Button) findViewById(R.id.no_thanks_button);
    dontRemind = (CheckBox) findViewById(R.id.dont_show_check_box);

    noThanks.setOnClickListener(new OnClickListener() {
      public void onClick(View v) {
        if (dontRemind.isChecked()) {
          SharedPreferences settings = getSharedPreferences(
              "dontRemindMe", 0);
          SharedPreferences.Editor editor = settings.edit();
          editor.putInt("dontRemindMe", 1);
          editor.commit();
        }
        startActivity(new Intent(context, MenuActivity.class));
      }
    });

    getIt.setOnClickListener(new OnClickListener() {
      public void onClick(View v) {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri
            .parse("market://search?q=pname:com.rahul.pDiary.pro")));
      }
    });
  }
  
  
  
  @Override
  public void onBackPressed() {
    startActivity(new Intent(context, MenuActivity.class));
  }



  @Override
  protected void onStop() {
    super.onStop();
    finish();
  }
}




Java Source Code List

com.rahul.pDiary.DbHandler.java
com.rahul.pDiary.DiaryApp.java
com.rahul.pDiary.EditActivity.java
com.rahul.pDiary.GoProActivity.java
com.rahul.pDiary.ImageAdapter.java
com.rahul.pDiary.MenuActivity.java
com.rahul.pDiary.MyCard.java
com.rahul.pDiary.NoteCardActivity.java
com.rahul.pDiary.NoteListActivity.java
com.rahul.pDiary.PasswordActivity.java
com.rahul.pDiary.PrefsActivity.java
com.rahul.pDiary.TypeActivity.java
com.rahul.pDiary.ViewActivity.java