小编Mar*_*ari的帖子

Android - 没有获得GCM令牌

我打电话给RegistrationIntentService:

    if (checkPlayServices()) {
        Log.i("udazzT", "check servicies");
        // Start IntentService to register this application with GCM.
        Intent intent2 = new Intent(this, RegistrationIntentService.class);
        startService(intent2);
    }
Run Code Online (Sandbox Code Playgroud)

但我在RegistrationIntentService中看不到任何日志:

public class RegistrationIntentService extends IntentService {

    private static final String TAG = "RegIntentService";
    private static final String[] TOPICS = {"global"};

    public RegistrationIntentService() {
        super(TAG);
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        Log.i("udazzT", "setting token");
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);

        try {
            // In the (unlikely) event that multiple refresh operations occur simultaneously,
            // ensure …
Run Code Online (Sandbox Code Playgroud)

android google-cloud-messaging

8
推荐指数
1
解决办法
7616
查看次数

如何更新com.android.application插件?

我收到这条消息:

Plugin is too old, please update to a more recent version,
or set ANDROID_DAILY_OVERRIDE environment variable to
"a9d6c794295e89d95704157e2ed8fd55ffd2765c"
Run Code Online (Sandbox Code Playgroud)

和:

C:\path\mobile\build.gradle
Error:(1) A problem occurred evaluating project ':mobile'.
Failed to apply plugin [id 'com.android.application']
Could not create plugin of type 'AppPlugin'.
Run Code Online (Sandbox Code Playgroud)

top build.gradel文件:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0-beta1'
        classpath 'com.google.gms:google-services:1.3.0-beta1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter() …
Run Code Online (Sandbox Code Playgroud)

android

7
推荐指数
2
解决办法
1万
查看次数

在android启动画面中为状态栏添加颜色

我在我的Android应用程序中添加了一个启动画面,我想在显示时给状态栏添加颜色.

这是drawable下的文件内容:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:drawable="@color/colorPrimary" />

    <item>
        <bitmap
            android:gravity="center"
            android:src="@mipmap/ic_home"/>
    </item>

</layer-list>
Run Code Online (Sandbox Code Playgroud)

我添加了这种风格:

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
    <item name="android:windowBackground">@drawable/splashscreen</item>
</style>
Run Code Online (Sandbox Code Playgroud)

android splash-screen

7
推荐指数
1
解决办法
4603
查看次数