更改应用程序的启动活动 [英] Change application's starting activity

查看:102
本文介绍了更改应用程序的启动活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了肉和我的应用程序的胆量,但我想补充一个不同的活动,这将是起点(排序一个登录屏幕)。

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).

夫妇的问题:

2。一旦我创建了一个新的活动,我怎么可以将其设置为我的应用程序的默认行为?我presume我可以改变类的名称。 ..但有一个更优雅的方式来处理(也许在的Andr​​oidManifest.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)?

推荐答案

是的,你是要去使用的Andr​​oidManifest.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆