I need to get reference to separate XML file which is FrameLayout but I can\'t figure out how to do it, this code doesn\'t work:
FrameLayout desktopFrameLayou
For that you have to use inflate view.
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.mylayout, null); FrameLayout item = (FrameLayout ) view.findViewById(R.id.desktopsFramelayout);