ITPub博客

首页 > IT职业 > > 静态内部类中重写HandleMessage方法

静态内部类中重写HandleMessage方法

作者:hedaodi 时间:2019-04-15 14:28:02 0 删除 编辑
静态内部类中重写HandleMessage方法,如何使用strateActivity(this,目标)
上面this哪里报错,应该如何解决
public static class InnerSplashHandler extends Handler{
     WeakReference<SplashActivity> mWeakReference;
     Context mContext;
    public InnerSplashHandler(SplashActivity splashActivity) {
        this.mWeakReference = new WeakReference<>(splashActivity);

    }
    @Override
    public void handleMessage(Message msg) {
        super.handleMessage(msg);
        switch (msg.what){
            case StaticClass.HANDLER_SPLASH:
                mContext.startActivity(this,GuideActivity.class);
this这里报错,提示startActivity(android.content.Intent,android.os.Bundle)in Context cannot be applied to
                break;
        }
    }


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1354/viewspace-3133765/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-15

  • 博文量
    107
  • 访问量
    1129