0

我正在学习 Android,无法让我的程序显示在我的 Nexus S 模拟设备的程序列表抽屉中。当我加载模拟器时,它确实在点击“运行新配置”后成功加载了我的程序。我知道这方面有很多线索......但据我所知,我的清单中的一切都是正确的:

  <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

另外,要明确 Eclipse 中的运行配置确实可以成功运行我的程序。它只是不在模拟设备的应用程序菜单/抽屉中单击并运行:

[2013-03-07 20:14:04 - TodDoList] New emulator found: emulator-5554
[2013-03-07 20:14:04 - TodDoList] Waiting for HOME ('android.process.acore') to be launched...
[2013-03-07 20:14:46 - TodDoList] HOME is up on device 'emulator-5554'
[2013-03-07 20:14:46 - TodDoList] Uploading TodDoList.apk onto device 'emulator-5554'
[2013-03-07 20:14:47 - TodDoList] Installing TodDoList.apk...
[2013-03-07 20:15:23 - TodDoList] Success!
[2013-03-07 20:15:23 - TodDoList] Starting activity com.paad.toddolist.ToDoListActivity on device emulator-5554
[2013-03-07 20:15:24 - TodDoList] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.paad.toddolist/.ToDoListActivity }

这是我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.paad.toddolist"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="4"
        android:targetSdkVersion="15" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.paad.toddolist.ToDoListActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

这是我的 strings.xml 文件:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">TodDoList</string>
    <string name="addItemHint">New To Do List</string>
    <string name="addItemContentDescription">New To Do Item</string>

</resources>
4

1 回答 1

1

尝试更换

android:name="com.paad.toddolist.ToDoListActivity"

android:name=".ToDoListActivity"
于 2013-08-23T11:33:40.587 回答