Android Open Source - GNE_Nepal_App test Activity






From Project

Back to project page GNE_Nepal_App.

License

The source code is released under:

GNU General Public License

If you think the Android project GNE_Nepal_App 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.yadaming.gne_nepal_app;
//  w  w w  .  j a va  2s  .  c o  m
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.app.Activity;



public class testActivity extends Activity {

    Button writeButton;
    CheckBox checkBox;

    String filename = "testFile";
    String filecontent = "filecontent variable not yet changed";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);

        // first, connect the checkbox and button in the layout to something usable here
        checkBox = (CheckBox) findViewById(R.id.checkBox11);
        writeButton = (Button) findViewById(R.id.button);
        // when the button is clicked, check to see if the box is
        writeButton.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View arg0) {
                if (checkBox.isChecked())
                {
                    filecontent = "checked";
                }
                else
                {
                    filecontent = "not checked";
                }
                fileIO fileio = new fileIO();
                fileio.write(filename, filecontent);
            }
        });
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_test, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}




Java Source Code List

com.yadaming.gne_nepal_app.Alcohol.java
com.yadaming.gne_nepal_app.Calcium.java
com.yadaming.gne_nepal_app.Cooking.java
com.yadaming.gne_nepal_app.End.java
com.yadaming.gne_nepal_app.Folate.java
com.yadaming.gne_nepal_app.Hand.java
com.yadaming.gne_nepal_app.Hygiene.java
com.yadaming.gne_nepal_app.InitialActivity.java
com.yadaming.gne_nepal_app.Iodine.java
com.yadaming.gne_nepal_app.Iron.java
com.yadaming.gne_nepal_app.Rice_main_circled.java
com.yadaming.gne_nepal_app.Rice_none_circled.java
com.yadaming.gne_nepal_app.Rice_right_circled.java
com.yadaming.gne_nepal_app.ScoreKeeper.java
com.yadaming.gne_nepal_app.Slide12Activity.java
com.yadaming.gne_nepal_app.Slide14Activity.java
com.yadaming.gne_nepal_app.Slide15Activity.java
com.yadaming.gne_nepal_app.Slide16Activity.java
com.yadaming.gne_nepal_app.Slide17Activity.java
com.yadaming.gne_nepal_app.Slide18Activity.java
com.yadaming.gne_nepal_app.Slide19Activity.java
com.yadaming.gne_nepal_app.Slide20Activity.java
com.yadaming.gne_nepal_app.Slide22Activity.java
com.yadaming.gne_nepal_app.Slide24Activity.java
com.yadaming.gne_nepal_app.Slide25Activity.java
com.yadaming.gne_nepal_app.Slide26Activity.java
com.yadaming.gne_nepal_app.Slide27Activity.java
com.yadaming.gne_nepal_app.Slide28Activity.java
com.yadaming.gne_nepal_app.Slide29Activity.java
com.yadaming.gne_nepal_app.Slide2Activity.java
com.yadaming.gne_nepal_app.Slide30Activity.java
com.yadaming.gne_nepal_app.Slide3Activity.java
com.yadaming.gne_nepal_app.Slide4Activity.java
com.yadaming.gne_nepal_app.Slide5Activity.java
com.yadaming.gne_nepal_app.Slide6Activity.java
com.yadaming.gne_nepal_app.Slide7Activity.java
com.yadaming.gne_nepal_app.Slide8Activity.java
com.yadaming.gne_nepal_app.SnackFoodActivity.java
com.yadaming.gne_nepal_app.SoundModule.java
com.yadaming.gne_nepal_app.VitaminA.java
com.yadaming.gne_nepal_app.Vitamin.java
com.yadaming.gne_nepal_app.WhyBeNutritious.java
com.yadaming.gne_nepal_app.fileIO.java
com.yadaming.gne_nepal_app.testActivity.java