小编usi*_*ing的帖子

使用android不推荐使用PushService类型的方法setDefaultPushCallback

我是android的新手.我一直在处理的问题,deprecated methodpush service使用parse服务.我在这里遇到类似问题的类似问题,但无法得到解决方案.在我的主要application class处理这个问题,下面给出了代码.

public class MApplication extends Application {
    private static MApplication mInstance;

    @Override
    public void onCreate() {
        super.onCreate();

        mInstance = this;
        Parse.initialize(this, JNI.stringFromJNI001(), JNI.stringFromJNI010());

        // Specify an Activity to handle all pushes by default.
        PushService.setDefaultPushCallback(this, MainLandingActivity.class);
// setDefaultPushCallback shows deprecated method here..

     ParseACL defaultACL = new ParseACL();
        // Optionally enable public read access.
        defaultACL.setPublicReadAccess(true);
        defaultACL.setPublicWriteAccess(true);
        ParseACL.setDefaultACL(defaultACL, true);

    }

    public static MApplication getInstance() {
        return mInstance;
    }

}
Run Code Online (Sandbox Code Playgroud)

在我manifest使用这个: …

android push deprecated parse-platform

6
推荐指数
1
解决办法
2210
查看次数

标签 统计

android ×1

deprecated ×1

parse-platform ×1

push ×1