Android Open Source - txttr Main Activity






From Project

Back to project page txttr.

License

The source code is released under:

MIT License

If you think the Android project txttr 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.izgoy.txttr;
//  w w  w  . j a va2s  .  c  o  m

import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;

public class MainActivity extends Activity implements View.OnClickListener {

    private CheckBox enableCheckBox;
    private SharedPreferences settings;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        settings = TxttrApplication.getSettings(this);

        enableCheckBox = (CheckBox) findViewById(R.id.enable);
        enableCheckBox.setOnClickListener(this);
        enableCheckBox.setChecked(settings.getBoolean(TxttrApplication.PREF_ENABLED, false));
    }

    private void onEnableClick(View view) {
        SharedPreferences.Editor editor = settings.edit();
        editor.putBoolean(TxttrApplication.PREF_ENABLED, enableCheckBox.isChecked());
        editor.commit();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.enable:
                onEnableClick(view);
                return;
        }
    }
}




Java Source Code List

com.izgoy.txttr.MainActivity.java
com.izgoy.txttr.SMSHandlerService.java
com.izgoy.txttr.SMSReceiver.java
com.izgoy.txttr.TxttrApplication.java
com.izgoy.txttr.UserManager.java