You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.IllegalArgumentException: Cannot add a null child view to a ViewGroup
at android.view.ViewGroup.addView(ViewGroup.java:4952)
at android.view.ViewGroup.addView(ViewGroup.java:4917)
at com.takusemba.spotlight.SpotlightView.startTarget(SpotlightView.kt:116)
at com.takusemba.spotlight.Spotlight.showTarget(Spotlight.kt:96)
Tried many things without success. I'm using java and in a Fragment
myView is found using Butterknife, and if I put a breakpoint before starting spotlight, it's not null
private List getTargets() {
List targets = new ArrayList<>();
targets.add(new Target.Builder().setAnchor(myView).setShape(new Circle(100f)).build());
return targets;
}
@OverRide
public void onViewCreated(View view, @nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
new Spotlight.Builder(getActivity()).setTargets(getTargets()).build().start;
}
The text was updated successfully, but these errors were encountered:
I just saw that if I put a .setOverlay(layout) it works fine.
I don't understand why it's mandatory to use a layout, furthermore it would be great to return a clearer exception message
Version 2.0.2
java.lang.IllegalArgumentException: Cannot add a null child view to a ViewGroup
at android.view.ViewGroup.addView(ViewGroup.java:4952)
at android.view.ViewGroup.addView(ViewGroup.java:4917)
at com.takusemba.spotlight.SpotlightView.startTarget(SpotlightView.kt:116)
at com.takusemba.spotlight.Spotlight.showTarget(Spotlight.kt:96)
Tried many things without success. I'm using java and in a Fragment
myView is found using Butterknife, and if I put a breakpoint before starting spotlight, it's not null
private List getTargets() {
List targets = new ArrayList<>();
targets.add(new Target.Builder().setAnchor(myView).setShape(new Circle(100f)).build());
return targets;
}
@OverRide
public void onViewCreated(View view, @nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
new Spotlight.Builder(getActivity()).setTargets(getTargets()).build().start;
}
The text was updated successfully, but these errors were encountered: