已安装应用但未自动启动

时间:2014-07-11 15:01:24

标签: android eclipse

我运行我的应用程序,它卸载了之前的应用程序&将新构建的应用程序放入我的设备中,这会导致我转到菜单,然后找到应用程序,然后点击它以运行...
这个问题只在eclipse的一个项目中找到。

控制台输出:

[2014-07-11 20:15:26 - MyApp] Android Launch!
[2014-07-11 20:15:26 - MyApp] adb is running normally.
[2014-07-11 20:15:26 - MyApp] Performing sync
[2014-07-11 20:15:28 - MyApp] Uploading MyApp.apk onto device '1C9E_9E18_MicromaxA111'
[2014-07-11 20:15:31 - MyApp] Installing MyApp.apk...
[2014-07-11 20:15:40 - MyApp] Success!
[2014-07-11 20:15:41 - MyApp] \MyApp\bin\MyApp.apk installed on device
[2014-07-11 20:15:41 - MyApp] Done!

我的清单

    <uses-sdk
    android:minSdkVersion="13"
    android:targetSdkVersion="16" 
    android:maxSdkVersion="19"/>

我的手机Android版本是4.1.2,所以我包括android:targetSdkVersion="16"并没有解决问题,我也重新启动了Eclipse&amp;我的设备也是。

有人可以解释一下为什么会这样吗?

更新 Manifest.xml

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

<uses-sdk
    android:minSdkVersion="13"
    android:targetSdkVersion="16" 
    android:maxSdkVersion="19"/>

<application
   android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
          android:configChanges="keyboardHidden|orientation|screenSize"

        android:name="com.example.myapp.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data
android:name="android.app.default_searchable"
android:value="com.example.MainActivity" />
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
    </activity>
</application>

</manifest>

1 个答案:

答案 0 :(得分:3)

单击运行按钮旁边的向下箭头,然后选择&#34;运行配置&#34;。

enter image description here

在对话框中,确保&#34;启动默认活动&#34;被选中。

enter image description here

相关问题