₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,317 members, 8,511,185 topics. Date: Sunday, 01 November 2026 at 01:07 AM

Toggle theme

Creating Multiple Activity In Android - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › Creating Multiple Activity In Android (1066 Views)

1 Reply

Creating Multiple Activity In Android by richardwalter(op): 3:48pm On Feb 15, 2017
Hello,

I am creating an application which has lots of buttons on home screen and upon clicking any button - opens new activity. I would like to know how to code for multiple activity from one single activity.
Please help..
Thanks..!!



About me:
I'm new in this forum, I have worked with multiple firms
You can check Marketing automation software video ,one of my work.
Re: Creating Multiple Activity In Android by simiolu1(m): 4:17pm On Feb 15, 2017
Re: Creating Multiple Activity In Android by Dekatron(m): 6:05pm On Feb 15, 2017
If I can get you right, all you need to do is declare intents. Lets say I have activity A and I want to go to activity B after I click activity A, I will declare an onClick method (actually, Override it. I hope you know what Overriding means in java).
button.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// editText = (EditText) findViewById(R.id.editText);
// mailText = (EditText) findViewById(R.id.emailText);
// passText = (EditText) findViewById(R.id.passwordText);
// String passMessage = passText.getText().toString();
// String mailMessage = mailText.getText().toString();
// String messageText = editText.getText().toString();
// Intent intent = new Intent(MainActivity.this, ReceiveActivity.class);
// intent.putExtra("message",messageText);
// startActivity(intent);
// Intent in = new Intent(MainActivity.this, ReceiveActivity.class);
// in.putExtra("emailText", mailMessage);
// startActivity(in);
// Intent ins = new Intent(MainActivity.this, ReceiveActivity.class);
// ins.putExtra("passwordText", passMessage);
// startActivity(ins);
//
// }
// });



That is just a test code. Hope you catch the drift.
1 Reply

What Programming Language Is Used In Creating Viruses? • Consuming Laravel Api In Android • Gradle Problem In Android Studio • 2 • 3 • 4

Learn Full Stack Website Development Online From Gurus In USA Free • Abuja To Host Cyber World Conference 2017 • AI And Automation, Everywhere