English 中文(简体)
• 如何回头发射机页,有意图?
原标题:How to go back to launcher page with intents?
  • 时间:2011-10-20 01:35:58
  •  标签:
  • android
  • menu

I am trying to go back to a previous activity using intents.

我的主页是我的问题,正是在我试图把名字和roid星说出来的时候,那一页。 作为我的意图,教育、青年和体育部让我选择开放所有东西。

我应该做些什么来解决这个问题? 我怎么能重新命名我的活动名称?

Thanks

在此,我

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.AssaultAlarm.full" android:versionCode="1"
    android:versionName="1.0">
    <uses-sdk android:minSdkVersion="5" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
     <uses-permission android:name="android.permission.READ_CONTACTS" />
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".AssaultAlarmActivity"
            android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Info" android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" android:label="@string/app_name">
            <intent-filter>
                <action android:name="com.AssaultAlarm.INFO" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:name=".Settings" android:screenOrientation="portrait" android:permission="android.permission.READ_CONTACTS"
            android:theme="@android:style/Theme.NoTitleBar" android:label="@string/app_name">
            <intent-filter>
                <action android:name="com.AssaultAlarm.SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
</manifest>

这就是我要说的话。

Intent info = new Intent("AssaultAlarmActivity.class");
            startActivity(info);
最佳回答

如果你想要从事以前的活动,你就可以完成目前的活动。 您将自动参加以往的打字活动,但如果您希望开展具体活动,你可以采取以下行动。

为什么你不使用明确意图。

Intent info = new Intent(CallingActivity.this,AssaultAlarmActivity.class);
startActivity(info);

如果你不希望使用明确意图,你可能会为你的活动增加新的意图过滤器

    <activity 以及roid:name=".AssaultAlarmActivity"
        以及roid:screenOrientation="portrait" 以及roid:theme="@以及roid:style/Theme.NoTitleBar"
        以及roid:label="@string/app_name">
        <intent-filter>
            <action 以及roid:name="以及roid.intent.action.MAIN" />
            <category 以及roid:name="以及roid.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action 以及roid:name="MyAction" />
            <category 以及roid:name="以及roid.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

以及

Intent info = new Intent("MyAction");
            startActivity(info);

如果你想要重新命名你的活动,你将采取以下行动:

    <activity-alias 以及roid:name="AlternateName"
        以及roid:targetActivity=".AssaultAlarmActivity"
    />
问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签