Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,813 members, 7,810,120 topics. Date: Friday, 26 April 2024 at 09:09 PM

Creating Multiple Activity In Android - Programming - Nairaland

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

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

(1) (Reply)

Creating Multiple Activity In Android by richardwalter: 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 Are My Chances Of Getting A Good Part Time Job As A Student In Canada / How Can I Block Certain Websites Like Facebook On A Network / I Need A Good Template, Please Help Me Out With It

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.