KeepSafe / TapTargetView

An implementation of tap targets from the Material Design guidelines for feature discovery.
Apache License 2.0
5.35k stars 587 forks source link

findViewById(R.id.target) not working #386

Closed keithchad closed 1 year ago

keithchad commented 3 years ago

Version used:1.13.2

Stack trace:

Android version:30

Issue Hello. I have a small issue. the findViewById(R.id.target) does not work.This is my first time using the library so I do not know where the problem is.Kindly Help me.

Screenshot attached below: Screenshot from 2021-03-24 21-03-13

angatha commented 2 years ago

Hi @keithchad, I guess HomeFragmentPatient is a Fragment. This class doesn't have a findViewById(int) method and this is causing your problem. (Needless to say it has nothing to do with this library.)

As far as I know, in an activity you have this method with is more or less a delegate to View#findViewById(int) of the root view of the activity. The method searches for a child of the view with the specified id. So in a fragment, most likely you wanted to do something like requireView().findViewById(R.id.textHeartbeat).

This searches for the textHeartbeat view in the views related to the fragment.