Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I got java.lang.ClassNotFoundException when i try to start activity of another application

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried with below example

Activity example

when i run the example and click the button to call other activity it givess me below exception



i run using real phone as well as emulator,but i got same results.when i tried with second app it works fine both emulator and device.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the app include that class?
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
of course ULF.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently Android doesn't think so, so it's a justified question. The next question, just as obvious: is it correctly declared as being an Activity in the manifest?

Have you tried making it the launch activity - does that work? If you haven't tried, that should be the next step.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my first app main class




this is main app layout file



this is main app manifest file



this is second app main class



this is second app layout file



this is second app manifest file



 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confused - you have two apps that have this activity? The one trying to launch it, and another one that has just that activity? So are you trying to launch a different app, or a different activity within the same app?
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as in the example below it tries to start an activity in a another application.
http://hmkcode.com/android-start-another-activity-of-another-application/
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You changed the intent-filter action - that is not how it is in the article. So the only activity that reacts to "com.hmkcode.android.another.app.ANOTHER_ACTIVITY" is the first app - which you said is not what you want. Why does the first app even have AnotherActivity in its manifest?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic