Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old September 1st, 2012, 09:53 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2012
Location: Michigan
Posts: 1
 
Device(s): LePan II, HTC Vivid
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default Multiple Activities showing as apps

My Background. Currently I am a .NET Developer working mainly with databases. Taking an interest in Android development by creating my first app. To understand it all, I am just trying to create a data collection application.

For example, collecting user information. My main activity will show a list of users and a button to add a new user. So, I created a new activity for the add a new user form.

I am using eclipse, with the normal AVD (ARM (armeabi-v7a)). I can successfully take the user to the add new form, no real issues with that. However, when I run the app in the AVD, I see my main activity (or the actual app) and the add new user activity as an app.

Why is that? Is there some way to define the main activity for the app?

Thanks in advance,
Kris

krisjl20 is offline  
Reply With Quote
sponsored links
Old September 1st, 2012, 10:09 AM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,936
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 478 Times in 292 Posts
Default

Yes, in your manifest file, you should have something like this:

Code:
<activity name=".MainActivityName" label="@string/app_name">
      <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
</activity>

<activity name=".AnotherActivityName" label="@string/app_name" />
Notice the intent filter in the first one. the android.intent.action.main value in the name field tells the system that it's the main activity
the android.intent.category.LAUNCHER value for the category field tells the system that the activity should be placed in the launcher.

Now, notice how the second activity has neither. It will not be designated as the main activity, nor will it be placed in the launcher.
jonbonazza is offline  
Reply With Quote
The Following User Says Thank You to jonbonazza For This Useful Post:
krisjl20 (September 2nd, 2012)
Reply
Tags
activity


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:18 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.