jeudi 27 janvier 2022

Invoking class under com.android.server.display in android using java reflection - possible or not?

I tried the following code but it throws "java.lang.ClassNotFoundException: com.android.server.display.DisplayModeDirector". Is this not possible or I'm just not doing it right?

val displayModeDirector = Class.forName("com.android.server.display.DisplayModeDirector")
val con = displayModeDirector.getConstructor(Context::class.java,Handler::class.java)
con.newInstance(applicationContext, Handler(Looper.getMainLooper()))

I am referring to this class





Aucun commentaire:

Enregistrer un commentaire