更改应用程序的启动活动 [英] Change application's starting activity
问题描述
我已经建立了肉和我的应用程序的胆量,但我想补充一个不同的活动,这将是起点(排序一个登录屏幕)。
I have created the meat and guts of my application but I want to add a different activity that will be the starting point (sort of a log-in screen).
夫妇的问题:
-
1我有怎样的活动(基于本文之间切换一个相当不错的把手: HTTP:/ /www.linux-mag.com/id/7498 ),但我不知道如何去创建一个新的(与Eclipse)
2。一旦我创建了一个新的活动,我怎么可以将其设置为我的应用程序的默认行为?我presume我可以改变类的名称。 ..但有一个更优雅的方式来处理(也许在的AndroidManifest.xml
)
2 Once I have a new activity created, how can I set it as the default activity of my application? I presume I could just change the name of the classes...but is there a more elegant way to handle that (maybe within the AndroidManifest.xml
)?
推荐答案
是的,你是要去使用的AndroidManifest.xml
文件,实际上你可以甚至拥有多个发射活动规定在您的应用程序清单。为了让看到你的清单将这些属性添加到您的活动发射活动:
Yep you are gonna use the AndroidManifest.xml
file, you can actually even have more than one launcher activity specified in your application manifest. To make an activity seen on the launcher you add these attributes to your activity in the manifest:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
这篇关于更改应用程序的启动活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!