This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call an activity in another application using intent?

 
Kev Lee
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have difficulty finding a more complete and perhaps well explained tutorial on how to call activity created and deployed in another Android application from my application. I have not been successful learning from what I found (getting activity not found error resulting from my intent.setComponent statement, which I am not absolutely certain I need) I think I can set the action field of the intent somehow to accomplish this. Please refer me to such resource if you can or kindly give me some pointers. Thanks!
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only discussion of how to do that I have seen was in this book (which I recommened for its other content anyway): http://shop.oreilly.com/product/0636920022596.do (And no, I don't recall the details, so I can't post 'em here...)
 
Kev Lee
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep getting "ActivityNotFoundException: Unable to find explicit activity class ... " when using Eclipse's emulator to call the activity of another application from an application. Perhaps the problem maybe related to not able to have both applications in the emulator at the same time because when I click on "Manage Applications" in Settings, only one of them is listed. This is the first project I need to call the activity of another application. If this is a problem how do I correct that? Thanks!
 
Przemek Boryka
Ranch Hand
Posts: 51
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !

I think you can't launch activity from other application because, to launch activity you must have inserted information about that activity in your AndroidManifest.xml file or you will get exception. You can launch other applications (not activity) like GPS or BluetoothModule but not any Activity of that applications (GPS, BluetoothModule).

If I was wrong, please tell my, becouse I am not one hundred percent sure of that

Sorry for my english, I am still learning
Bye !
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Przemek Boryka wrote:I think you can't launch activity from other application because, to launch activity you must have inserted information about that activity in your AndroidManifest.xml file or you will get exception.

In other words, you can do it?

It's perfectly possible to launch activities that are part of other apps if those apps have declared the activities in question as public (via the exported attribute). It's also permissible for different apps that share the same UID - the most common case of that would be apps written by the same developer.

This is all explained in depth in the book I mentioned. Every serious Android should get it, as it's inexpensive, and security is very important for mobile devices. (I have no financial interest in the book, I just think it's an important subject that is not sufficiently discussed in general.)
 
Przemek Boryka
Ranch Hand
Posts: 51
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !

Ulf Dittmer wrote:
In other words, you can do it?

It's perfectly possible to launch activities that are part of other apps if those apps have declared the activities in question as public (via the exported attribute). It's also permissible for different apps that share the same UID - the most common case of that would be apps written by the same developer.

This is all explained in depth in the book I mentioned. Every serious Android should get it, as it's inexpensive, and security is very important for mobile devices. (I have no financial interest in the book, I just think it's an important subject that is not sufficiently discussed in general.)



So, I was wrong, I didn't knew that I can launch special prepared activity from other app. Now, I will be know it, that I can. ;)

I bought the book you prefer, now I think, I will be more smarter.

Greetings from Poland.
 
Mohan Prasath
Ranch Hand
Posts: 38
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To open another application's activity you must have declared the appropriate activity in your AndroidManifest file.. Have you declared it in your Manifest file?.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic