1. Are you ready for the Galaxy S20? Here is everything we know so far!

Apps Need Help with User Interfaces

Discussion in 'Android Development' started by MallowGirl12, Jul 27, 2013.

  1. MallowGirl12

    MallowGirl12 Newbie
    Thread Starter

    I am doing an an android application on student app. I have managed to make the buttons, however i need help in submitting the login details of a s creenshot where a user can login to their account. I also need help with listview in making a good one displaying list of students registered in an IT course. These are the codng that has been used so far, which have worked perfectly fine



    mport android.app.Activity;
    import android.os.Bundle;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.Button;
    import android.widget.Toast;


    public class MainActivity extends Activity implements onclicklistener{ Button b1,b2,b3;

    public void onCreate(Bundle savedInstanceState)
    { super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    b1 = (Button) findViewById(R.id.button1);
    b2 = (Button) findViewById(R.id.button2);


    b1.setOnClickListener(new OnClickListener() {
    public void onClick(View v) { Toast msg = Toast.makeText(getBaseContext(), "You have clicked name", Toast.LENGTH_LONG); msg.show(); } });


    b2.setOnClickListener(new OnClickListener() { public void onClick(View v) { Toast msg = Toast.makeText(getBaseContext(), "You have clicked course", Toast.LENGTH_LONG); msg.show(); } }); } }



    import android.os.Bundle; i
    mport android.app.Activity;
    import android.view.Menu; i
    mport android.view.View.OnClickListener;
    import android.content.Intent; i
    mport android.view.View;
    import android.widget.Button;

    public class MainActivity extends Activity { Button b1,b2,b3;


    public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

    b1 = (Button) findViewById(R.id.button1); b2 = (Button) findViewById(R.id.button2); b3=(Button) findViewById(R.id.button3);
    b1.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent i = new Intent(getApplicationContext(), Name.class); startActivity(i); } });

    b2.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent i2 = new Intent(getApplicationContext(),Course.class); startActivity(i2);
    } });


    b3.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent i3 = new Intent(getApplicationContext(),Result.class); startActivity(i3);
    } });
    }
    }
     

    Advertisement

  2. Petrah

    Petrah Psychotic Female

    Hi there MallowGirl :)

    I've moved your thread over to Application Development where hopefully it will get more attention from those better suited to assist you (other developers).

    Let us know if you need anything else!

    Have a great weekend. :)
     
Loading...

Share This Page

Loading...