这是我的代码
int badgeCount = 3;
try {
Badges.setBadge(ProviderHomepage.this, badgeCount);
Log.d("BadgeSUCCESS", "BadgeSUCCESS");
} catch (BadgesNotSupportedException badgesNotSupportedException) {
Log.d("BadgeERROROROROROR", badgesNotSupportedException.getMessage());
}
清单文件应用图标是我的应用图标
<application
android:icon="@drawable/logofour"
/>
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
useLibrary 'org.apache.http.legacy'
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.bindaspunch.my.bindaspunch"
minSdkVersion 13
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/anim'] } }
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile files('libs/simple-side-drawer2.jar')
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:23.4.0'
// compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.google.android.gms:play-services-maps:8.1.0'
compile 'com.google.android.gms:play-services-plus:8.1.0'
compile 'com.android.support:design:23.4.0'
// compile 'com.google.android.gms:play-services:9.4.0'
compile files('libs/volley.jar')
// compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.4.0'
// compile files('libs/gcm.jar')
compile files('libs/gcm.jar')
compile 'com.android.support:support-v4:23.1.1'
// compile 'com.android.support:support-v4:21.0.3'
compile 'it.sephiroth.android.library.picasso:picasso:2.5.2.4b'
compile "com.squareup.picasso:picasso:2.4.0"
compile 'com.github.arturogutierrez:badges:1.0.5@aar'
}
代码参考是
https://github.com/arturogutierrez/Badges
有一个错误,即当前回家&#34;徽章库不支持启动器&#34;在我的logcat中,我无法更改应用程序图标;
当我从Manifest类中删除app图标时,错误仍然存在...比...更改了什么
我试着这个直到昨天但是它有问题,我不能使用这个代码,亲自帮助我解决这个问题... 抱歉我的英语和thnx提前...