繁体   English   中英

通过Eclipse在物理Android设备上安装了HelloWorld应用。 我如何在电话上找到它?

[英]Installed HelloWorld app on physical Android device through Eclipse. How do I find it on phone?

Eclipse中的控制台说:

[2014-03-10 17:46:08 - MyFirstApp] ------------------------------
[2014-03-10 17:46:08 - MyFirstApp] Android Launch!
[2014-03-10 17:46:08 - MyFirstApp] adb is running normally.
[2014-03-10 17:46:08 - MyFirstApp] No Launcher activity found!
[2014-03-10 17:46:08 - MyFirstApp] The launch will only sync the application package on the device!
[2014-03-10 17:46:08 - MyFirstApp] Performing sync
[2014-03-10 17:46:17 - MyFirstApp] Uploading MyFirstApp.apk onto device 'TA88307T9S'
[2014-03-10 17:46:17 - MyFirstApp] Installing MyFirstApp.apk...
[2014-03-10 17:46:19 - MyFirstApp] Success!
[2014-03-10 17:46:19 - MyFirstApp] \MyFirstApp\bin\MyFirstApp.apk installed on device
[2014-03-10 17:46:19 - MyFirstApp] Done!

那是从网上导入Hello World应用程序之后。 现在,我希望在手机上找到一个应用程序图标以启动它,但找不到。 如何启动该应用程序?

在Merlevede回答之后,我的清单xml文件现在看起来像这样:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="19" />

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

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:debuggable="true"
    android:theme="@style/AppTheme" >

</application>

</manifest>

但是问题仍然存在。

问题出在您的Android Manifest xml文件中。 您的主要活动缺少某些行( MAIN操作或LAUNCHER类别)。

<activity android:name="mx.company.app.ActivityMain" android:label="@string/title_activity_main" >
    <intent-filter android:label="@string/app_name">
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

找不到启动器活动!

日志显示您没有启动器活动。 为了解决这个问题,请按照您的要求进行任何活动

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myfirstapp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:debuggable="true"
        android:theme="@style/AppTheme" >

        <activity
            android:name="com.example.myfirstapp.MainActivity"
            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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM