Android get link to code layout

I need to get a link to a separate XML file, which is FrameLayout, but I can’t figure out how to do this, this code does not work:

FrameLayout desktopFrameLayout = (FrameLayout) findViewById(R.id.desktopsFramelayout); desktopFrameLayout.setDrawingCacheEnabled(true); desktopFrameLayout.buildDrawingCache(); Bitmap bitmap = desktopFrameLayout.getDrawingCache(); 
+6
source share
1 answer

To do this, you need to use the inflation 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); 
+15
source

All Articles