search

Home  >  Q&A  >  body text

android - 父类BaseActivity中定义了方法 子类DialActivity覆盖这个方法只执行一次

在写android程序,父类BaseActivity中定义了方法onCalling(String id){}, 子类DialActivity覆盖这个方法onCalling(String id){xxxxx}.

调试发现只有第一次运行程序时, 子类的方法被执行了,以后就再不被执行了,

ringa_leeringa_lee2948 days ago507

reply all(4)I'll reply

  • 迷茫

    迷茫2017-04-17 17:36:13

    The description is not detailed enough. The subclass inherits baseActivity and overrides the method. If the parent class or subclass executes it, it will be executed. If it is not executed, it will not be a problem with the logic here. It should be because you did not pay attention to other details

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:36:13

    I just solved it by broadcasting it to the sub-Activity

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 17:36:13

    Breakpoint debugging method to check the execution frequency of relevant code and make appropriate changes

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 17:36:13

    1. You need to understand what your own problem is
    2. Describe your problem completely

    reply
    0
  • Cancelreply