• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

how to declare two packages with their activities in androidmanifest.xml ?

 
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I created two packages, one "com.application.login.Login" contains the login class it is an activity, and the other "com.application.activity.MainActivity" the Mainactivity it's also an activity.
The launcher activity is the Login then when i clicked on button "Login" the MainActivity appears, i haven't problem in this step but ,
when i pressed a button in the mainactivity to return to the Login interface, the logcat display an error :



Here's the AndroidManifest.xml:

Here's the code :
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a couple ways to create an intent. You are using an action to do so when you do this:

To make that work, you need to add an additional intent filter to the activity. You know how to do that because you did it for the main activity.

The other way (and the way I would choose to do it would be to create an explicit intent to the activity, using a context (the current Activity) and the other Activity's class:

The difference is who can call your Activity. If you use the first method, then other applications could call your Activity, while the explicit call can only be used from the same application. I generally use the second method except for those few launch-points I want to have to enter my app.
 
Sarra Sakka
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Steve
the second method work very well
 
reply
    Bookmark Topic Watch Topic
  • New Topic