Android PushService类型中的方法setDefaultPushCallback不适用

Android PushService类型中的方法setDefaultPushCallback不适用,android,Android,错误:方法setDefaultPushCallback(Context,Class您应该使用getApplicationContext()或yourActivity。这将用于获取上下文。。 像这样 try { runOnUiThread(new Runnable() { public void run() { GetOtherData getOtherData = new GetOtherData();

错误:
方法setDefaultPushCallback(Context,Class您应该使用
getApplicationContext()
yourActivity。这将
用于获取上下文。。
像这样

try {
        runOnUiThread(new Runnable() {
            public void run() {
                GetOtherData getOtherData = new GetOtherData();
                getOtherData.execute();
                PushService.setDefaultPushCallback(YourActivity.this, MenuActivity.class);
                ParseInstallation.getCurrentInstallation().saveInBackground();
                ParseAnalytics.trackAppOpened(getIntent());

            }
        });
    } catch (Exception e) {
        e.printStackTrace();
    }

希望这有帮助。

我也有同样的问题。在setDefaultPushCallback中,如果用户按back按钮,您应该指定要显示的活动。我可以通过更改此行来编译:

PushService.setDefaultPushCallback(this, MenuActivity.class)
对于这一个:

PushService.setDefaultPushCallback(this, MainActivity.class)

我希望这有帮助。

检查android的版本号
parse xxx.jar
(xxx是版本号),如果使用旧版本,方法
setDefaultPushCallback
将不适用,我在使用parse1.4.jar时遇到了这个错误

没有显示错误,但应用程序没有使用修改过的代码启动。
PushService.setDefaultPushCallback(this, MainActivity.class)