如何改变在Android的启动活动? [英] How to change the startup activity in android?

查看:97
本文介绍了如何改变在Android的启动活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个活动,分别是登录日历在我的应用程序。目前我启动的活动是日历。我想运行登录作为第一个活动不是日历

I have two activities namely login and calendar in my Application. Currently my startup activity is "calendar". I want to run the login as first activity not calendar.

推荐答案

的启动活性发射活动]在项目的Andr​​oidManifest.xml文件中声明

The startup activity [Launcher Activity] is declared in the projects' AndroidManifest.xml file

查找在清单中的活动标签,它看起来像这样

Look for that activity tag in the manifest which looks like this

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

看属性机器人:名称。主要是应用程序启动时,它推出的类。目前您的日历活动名称应该在那里。改变你的活动,要启动的.classpath。

Look at the attribute android:name. Main is the class which is launched when the app starts. Currently your calendar activity name should be there. Change that to the .classpath of your activity that you want to launch.

这应该这样做。您可能还需要做的,教程并通过该文档的Hello World应用程序了一点怎么看的Andr​​oid应用程序的工作。

That should do it. You may also want to do the hello world application in the tutorials and go through the docs a little to see how Android Applications work.

这篇关于如何改变在Android的启动活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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