I Am Creating A Voting App For Our School And I Need A To Create A Database 
To Store The Votes. This Is The video 
<https://drive.google.com/file/d/0B_2yEG1zhfxwNTlWSlc4Zjc4QWM/view?usp=sharing> 
This 
Is The Result Activity <http://i.stack.imgur.com/9eVTV.png>

This Is The Result.java

 package com.unicorninteractive.ssgelectionmobilerssths;

    import android.database.sqlite.SQLiteDatabase;
    import android.os.Bundle;
    import android.support.v7.app.AppCompatActivity;
    import android.widget.Button;
    import android.widget.TextView;

    public class results extends AppCompatActivity {

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


   }}

And This Is The President.java (Voting Activity)

package com.unicorninteractive.ssgelectionmobilerssths;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.Toast;
public class President extends AppCompatActivity {
Button btn_votep;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_president);
    btn_votep = (Button) findViewById(R.id.btn_votep);
    btn_votep.setOnClickListener(btnlistener);
    Toast toast=Toast.makeText(this, "Your Vote Is Now Counted", 
Toast.LENGTH_LONG);
    toast.show();
}
public void onRadioButtonClicked(View view) {
    // Is the button now checked?
    boolean checked = ((RadioButton) view).isChecked();

    // Check which radio button was clicked
    switch(view.getId()) {
        case R.id.rb_p1:
            if (checked)
                // President 1
                break;
        case R.id.rb_p2:
            if (checked)
                // President 2
                break;
    }}


private View.OnClickListener btnlistener = new  View.OnClickListener(){

    @Override
    public void onClick(View v) {
        Intent intent = new Intent(President.this , Vicepresident.class);
        startActivity(intent);
       }
     };
   }



-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/649dbb60-5c9a-4db0-8821-62f62393890c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to