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 projec
Have you got the
Declared in your manifest?
Also if you want the entire view try this:
view1.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(view1.getDrawingCache());
Oh and this may save you some time:
private void openScreenshot(File imageFile) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Uri uri = Uri.fromFile(imageFile);
intent.setDataAndType(uri, "image/*");
startActivity(intent);
}
Src: How to programmatically take a screenshot in Android?