xtensivearts - One Leap Ahead
Episode #11 – Intents: Multi Activity Applications

Episode #11 – Intents: Multi Activity Applications

Posted 04/16/2010 - 9:42 pm by Mathias Reisch

In this episode we pick off right where we left last time. So far we developed small applications that had one single activity. In the last tutorial we had a look at how to call other activities that are provided by other Android applications. If you want to know how to create your very own activity and how to incorporate it into your application, well, read on.

Extend Your Knowledge

It is needless to say that it is generally not very common among actual real-world applications to consist of only one lonesome activity. Thus, in this second tutorial about Intents, we want to develop an application that has two activities. It shows the basic concept of creating multi activity applications and you can certainly use the knowledge you get from this tutorial to create applications with virtually any number of activities. So, if you are curious about how that is done, look no further, the tutorial is right here.

The Tutorial

You have any questions regarding this tutorial? You want to share your thoughts about this tutorial or this site in general? Please feel free to leave a comment below. It is much appreciated.

As always, you can find the project files for this tutorial here: Episode #11 Project Files (.zip)

Related posts:
  1. Episode #10 – Intents: An Introduction
  2. Episode #6 – Notification & Long Clicks
  3. Episode #3 – Using Buttons
  4. Episode #4 – Checkboxes & Complex Layouts
  5. Episode #5 – Using Radio Buttons
  6. Episode #8 – The Alert Dialog
  7. Episode #9 – Lists: Item Clicks
  8. Episode #2 – Create A New Project And Run It
  9. Episode #7 – Using Basic Lists
  10. Episode #1 – Getting Started!

Why Not Leave a Comment?

Name:*
E-Mail:*
Website:
Comment:*

Comments

Aleprex

04/17/2010 – 3:41 pm

Good work! Thanks for another awesome video tutorial.

pedro

04/17/2010 – 4:43 pm

Very nice tutorial ;)

Barry

04/22/2010 – 12:45 am

Another great tutorial. Are you going to be publishing tutorials on a more regular basis? this is a great series, Good Job! Keep them coming.

Mathias Reisch

04/22/2010 – 1:04 am

Thank you Barry. I will certainly try to publish tutorials much more frequently.

mhor

04/26/2010 – 5:16 am

Impressive Mathias. You really are skillful in android development and as a teacher as well. Looking forward for more videos. Your site is on my bookmarks now and I visit this everyday to check for updates.

I hope there could be a tutorial on mobile to PC connection (USB or WIFI or Bluetooth). I would like to create a some kind of remote desktop application and a handler/manager for sms and calls on PC.

Ryan

04/28/2010 – 6:01 am

Your work is pure genius; I’ve cherished every tutorial you’ve made.
I just started working on Android Development yesterday, and your tutorials are REALLY insightful.
I have this bookmarked, and I can’t wait for the next tutorial! I’m literally crazily excited about your tutorials. So don’t stop any time soon. ;)
Keep up the good work! :)

Ryan

04/30/2010 – 2:22 pm

One thing I’d like to remind you with guys though.
The OnClick Handler you can specify in the XML, making OnClick Listeners easier to do, only works in Android 1.6 and up.
Meaning, your Application won’t work on phones with lower versions.
If you plan on selling your Application, be sure to include which version of Android people are going to need to use it.
If you don’t, people might end up wasting their money, and their going to one star your Application with a nasty review.

Does the Android Market only list Applications that your phone can handle according to your Android Version?

Siddharth

05/04/2010 – 11:31 am

Hey Mathias. You would probably recognize me from an earlier comment in tutorial #8. That was solved by the way. :)

Anyway, I really enjoyed this tutorial a lot and have started working on a combination of this tutorial with a ListView (from tutorial #7) as an Intent. That, I might add, has been a stumbling block.

What works currently is the interface I created and as pointers to what functions the buttons will do, i am displaying toast messages.

Any ideas on how to go about it?

Eager for a reply

Cheers….

Avinash

05/04/2010 – 11:34 am

great naraation. what verion of api is used ? awaiting ur next tutorial.

Mathias Reisch

05/04/2010 – 12:39 pm

Hey Siddharth. It is good to hear that you try to combine the techniques from several tutorials. However, you might want to wait for the upcoming tutorial on databases, as this one will basically feature an application with a ListView as a second Activity.

Mathias Reisch

05/04/2010 – 12:41 pm

Hey Avinash. This particular sample application uses the Android 2.1 platform (API Level 7). Cheers!

Siddharth

05/04/2010 – 8:07 pm

Hello Mathias.

Thanks for the heads-up…. ;)

However, I would like to continue experimenting while you work on the next tutorial.

After having learned so much from your tutorials and essentially YOU, it would be a great disservice to you if people like me weren’t to eventually start doing things by themselves. And I sincerely believe, that is the whole point of these incredible tutorials that you keep producing one after the other.

Having said that, I know I will need the next tutorial in a big way. :)
And I will wait for it like i have never before….

Cheers….

Siddharth Lele

endryha

05/05/2010 – 3:52 pm

Good work

Oz

05/14/2010 – 8:06 pm

Thank you for your hard work Mathias! You’re videos are among the the best tutorials I’ve ever seen.

Rishabh

05/24/2010 – 1:02 am

This is the best dev video tutorial that I have seen. Really lucid, well structured and pragmatic approach. you’ve really taken the extra effort to teach and it shows in the quality.

Chris

05/25/2010 – 6:22 pm

I love your tutorials – please keep up the community encouragement.

NHugo

05/29/2010 – 7:24 pm

How to pass the value set in the first view to the color picker on a second call?

Milford

05/30/2010 – 4:05 pm

Love the videos, but could you please allow direct download or the ability to speed up playback? People often learn faster than an instructor talks and I like to play these types of videos at 1.5x speed.

Mathias Reisch

05/31/2010 – 12:20 pm

Hey Milford,

I’m afraid that is not possible because the hosting service for the videos does not support downloading or faster playback.

Ido

06/02/2010 – 11:31 am

When will you cast the next tutorial ?
this is great!

Mathias Reisch

06/02/2010 – 8:56 pm

A new tutorial will probably be out sometime next week.

pranay

06/08/2010 – 11:35 am

excellent tutorials.Could you please provide your email-id for some other queries in android other than these tutorials ?

Dionisis

06/26/2010 – 11:27 am

Hello Mathias. That was very cool!!

Do you have any apps of yours t show as? just to cheer up for you and to take some ideas!! :)

Thank you!!

asim

06/30/2010 – 11:33 pm

hello,,
awesome tutorials.. great learning..
if you can do some tutorials on the camera functions (like taking picture, zoom in/zoom out, turn led on/off … ) would be a great help..
thanks in advance

Erik

07/02/2010 – 9:31 pm

Great video series!

Been quite a wile since last update…

Waiting for another one.

Thanks!

Viktor

07/05/2010 – 12:40 am

Another wonderful tutorial. Thanks from Sweden! :-)

It is possible to show how to deal with background images and icons etc? Would be appreciated!

Thanks

Cliff

07/05/2010 – 2:06 am

Exactly what I was looking to learn!

Appreciate the awesome tutorial and look forward to more – keep up the good work!

ratso

07/18/2010 – 6:27 am

great tutorials, best i’ve seen on the internet. can’t wait until the next tutorial.

John

07/18/2010 – 11:21 am

Great Tutorials! All of them and i look forward to even more. If you are taking requests, Databases(which you mentioned in the least tutorial), and Gestures.

usetheforcehan

07/20/2010 – 1:29 pm

WOW! You sure can teach! XD

You’ve help me a lot and i can’t wait for your Databases tutorial vid.

Btw, it seem my eclipse cannot show any of Javadoc documents. Do you know what the problem is? I already Install and uninstall eclipse, Android SDK and JDK multiple times and it still doesn’t show up. :(

Any help will be apreciated! :D

Allen

07/23/2010 – 4:54 pm

Where are the rest of the tutorials? It’s been several months — and Mathias Reisch is the best!

Peppe L-G

07/24/2010 – 11:29 am

These tutorials are the best tutorials I’ve ever watched, you’re really got talent for making them.

As many other, I’m looking forward to the next tutorial. You know, if you’re going to make one sooner or later, it’s better to make it sooner ;)

Thanks a lot!

Ajay Mishra

07/25/2010 – 10:16 pm

Thank u so much for this wonderful post. I loved it…

ratso

07/31/2010 – 10:00 pm

You’ve got the best tutorials I’ve seen on the internet; with your teachings behind me, I’ve written my first functional android application!

ECDiet2009

08/02/2010 – 1:07 pm

Thank t you very much for your excellent work. I wish you can publish more tutorials. Great Job.

ratso

08/03/2010 – 10:56 pm

Mathias, i have question.
After setting the color in your application, in the second activity, it takes you back to the original activity, BUT, when you access the second activity, the radio button you chose is no longer selected. Is there some way to make the second activity ‘remember’ it’s settings? I.E. How could I make the color picker remember the last selected color?

Mathias Reisch

08/04/2010 – 1:40 am

Hey ratso,

the putExtra() and getExtra methods should work both ways. So before calling the second activity, you could store some color related data into the intent object. Then call the second activity and evaluate the stored data and finally set the corresponding radio button. Try it!

Glenn T.

08/04/2010 – 2:07 am

Thank you very much for the excellent tutorials, Mathias! I just watched all your tutorials in one sitting and I’m ready for more. =)

You are a great teacher because you talk at a perfect pace, and you don’t assume that the viewer knows too much or too little about Android. My background is in .NET, so I appreciate the keyboard shortcuts and the side-tips you throw in there.

I look forward to seeing the next in the series. In the meantime, I’ll be telling my friends about your excellent website.

KK

08/04/2010 – 7:39 pm

You have done a great job.
Can you give a tutorial on DATABASE and MAP

rasto

08/06/2010 – 7:47 pm

@Mathias Reisch

so then, the second activity should have an onActivityResult?

Mx

08/07/2010 – 8:56 am

I just finished watching all of your tutorials and I just wanted to say thanks. I have been reading and watching different android resources trying to wrap my head around this stuff and your tutorials have just been incredibly, incredibly helpful. The best and clearest I have seen so far. I’m sad I’m at the end of them! Thanks again!

Musa

08/12/2010 – 8:48 pm

Great job Mathias!! Your tutorials have greatly eased the learning curve of android programming… Please keep it up!!

Dopre

08/22/2010 – 1:42 pm

Hi Mathias,
great tutorial. I watched all of them in a row and was able to develop my first app. All this in just two days. Amazing.

rahul

08/25/2010 – 7:54 pm

Thanks… but when will u come up with more…

Srinivas

09/02/2010 – 1:35 am

These are wonderful and well articulated. These vidoes supplement any book you read and reinforce the concepts. Looking forward for more.

ernie

09/02/2010 – 9:35 pm

Excellent tutorial as usual but the author is busy and can not produce episodes frequently. For those who want to learn more about Android, Google University has free courses also.

http://sites.google.com/site/androidcoursearchive/labs/lab-1

Vanja

09/03/2010 – 2:51 pm

I hope this is not the last one in this series of great (and rare) video tutorials on Android development.! Hoping to see one on databases you mentioned..Thank you!

maggie

09/06/2010 – 1:22 am

Loved the tutorial and your teaching style. I just found this site. I watched this because I am trying to learn how to use intents. This was somewhat helpful. But I am trying to just pass a variable from ActivityClassA to ActivityClassB to be used there. Any suggestions? I used putExtra; but can’t quite get the syntax right on getExtra.

Prasanna

09/08/2010 – 5:09 am

Thank you Mathias, this tutorial series is awesome. Truly this is the best follow along video tutorial series i have used.

-Prasanna

Radu

09/14/2010 – 8:00 pm

Next video?!