i've encountered a strange problem with view positioning..
the code i have is roughly like so:
FrameLayout frame = callback.getFrame();
CustomView v = new CustomView(getActivity());
frame.addView(v);
v.setX(someX);
v.setY(someY);
//go on and do other stuff..
whereas the callback is the mainActivity that implements an interface where i've put the method getFrame(), which returns the FrameLayout declared in the main layout file.
i've also tried using a different approach as mentioned here Set the absolute position of a view
but still, stangely enough on the emulator the view does get shown in the proper place, but on an actual device it does not, i mean not shown, or shown at the edge of the FrameLayout.
i've tested it with my nexus 5 phone, (LG, API 23) also on a SAMSUNG 7J (API 25) with the same result, and as i mentioned, when i test it on the emulator with the same API level, things work as intended. the only "Solution" i came up with was to animate() the view which does put it where i wanted, but it just does not feel right.
has anyone encountered this? what should i do?