Android/Java: Calling a method using reflection?

后端 未结 4 1336
轻奢々
轻奢々 2020-12-10 15:26

I have a static method titled chooseDialog(String s, int i) in which I want to call another method within the same class (Dialogs.class) based on the parameters provided to

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 15:49

    Method method = Dialogs.getMethod(s, Integer.class);
    method.invoke(null, i);
    

提交回复
热议问题