javaandroidhuawei-mobile-serviceshuawei-developersharmonyos

What is the alternative in HarmonyOS for activity.findViewById(android.R.id.content) in Android OS?


I am writing a helper class to zoom an image in HarmonyOS using Java SDK. To get the current view which is being zoomed in Android we can use activity.findViewById(android.R.id.content).

What is the alternative for the above in HarmonyOS?


Solution

  • in Android we can use activity.findViewById(android.R.id.content). What is the alternative for the above in HarmonyOS?

    In HarmonyOS we use findComponentById(ResourceTable.Id_xxx). Just Try this.