我正在学习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>
答案 0 :(得分:1)
尝试替换
android:name="com.paad.toddolist.ToDoListActivity"
与
android:name=".ToDoListActivity"