How to take screenshot of a layout in android
I want to save my frame layout into gallery by taking the screen shot of the layout. This code works on a project(Name: Trial), but when I tried the same code on othe project(Name: Fg), It did not work. The photo is not being saved in the Gallery. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_background); } public Bitmap click(View view) { FrameLayout memecontentView =(FrameLayout) findViewById(R.id.my); View view1 = memecontentView; Bitmap b = Bitmap.createBitmap(view1.getWidth(), view1.getHeight(), Bitmap