android - 无法更改 Android 应用程序的默认图标?

标签 android eclipse cordova icons

我遇到了一个问题。我已经使用 phonegap、cordova 和 eclipse 将 javascript 应用程序转换为 Android 应用程序。该应用程序运行良好。

但问题是,它总是显示cordova icon as app icon。我替换了 "project/res" 文件夹中的所有图标。但它仍然只显示默认图标吗?

我在谷歌上搜索了一下,发现我必须更改 list 文件。所以,我在 AndroidManifest.XML 中更改了代码,

android:icon="@drawable/icon"

“icon” 是我的图片名称。

这里有什么问题?为什么我没有自己的图标?我是这个 Android 环境的新手。

我关注了这篇文章http://smartgap.wordpress.com/2012/08/11/customizing-launch-icon-on-eclipsephonegap-application/

我的 list 文件:

<?xml version="1.0" encoding="utf-8"?>
<!--
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:windowSoftInputMode="adjustPan"
      package="com.mage.edunxt" android:versionName="1.0" android:versionCode="1" android:hardwareAccelerated="true">
    <supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true"
        android:resizeable="true"
        android:anyDensity="true"
        />

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.RECORD_VIDEO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />   
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />   
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />

    <application android:icon="@drawable/icon" android:label="@string/app_name"
        android:hardwareAccelerated="true"
        android:debuggable="true">
        <activity android:name="EduNxtQTIPlayer" android:label="@string/app_name"
                android:theme="@android:style/Theme.Black.NoTitleBar"
                android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

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

最佳答案

我必须做以下事情

  1. 将所有文件添加到我的 res/Drawables 文件夹
  2. 在 manifest.xml 中设置 Activity 的图标属性。它让我可以选择浏览我的 Drawable 目录中的文件设置。
  3. 我必须清洁它才能工作。

清洁非常重要,似乎一直使用旧图标直到您清洁为止。

在eclipse项目中->清理

关于android - 无法更改 Android 应用程序的默认图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16010313/

相关文章:

java - Android 初学者 : Email and Strings

android - 如何禁用 ANDROID 以及在 Phonegap 应用程序中长按屏幕后出现的 IOS 的复制和粘贴文本功能

html - Cordova IOS 8 选择元素

java - Espresso 图像选择器 - CursorIndexOutOfBoundsException 错误

android - 如何使用 HttpPost 或 get 从该网站获取正文结果?

android - HSPA 与 HSPAP 之间有什么区别

android - 在 this.state.message 中显示接收者消息

android - SQLite SELECT 给出异常如何解决?

windows - 用于在同一项目上使用 Windows 和 Linux 的 eclipse 字符集

javascript - 如何从 Angular Controller 中的 Phonegap 插件访问值?