“Cannot make a static reference to a non-static method” in Android

前端 未结 2 1213
天命终不由人
天命终不由人 2020-12-19 09:56

I\'m having some issues with the old \"Cannot make a static reference to a non-static method\" error in my Android program. I am creating a sand falling game (similar to the

2条回答
  •  离开以前
    2020-12-19 10:18

    if the create is called by ANDROID, so you do not create the instance, just put into the create mShowDialog=this or mShowDialog=pShowDialog

    in other words - have the create save the instance value also you can add a public get to get that instance value. Then you can access the instance function through the abstract by interceding the getter:

    ABSTRACTCLASS.getInstance().applyFunction();
    

提交回复
热议问题