Nisha
Nisha

Reputation: 132

how to take a screenshot of an android layout?

my question is how do I take a screenshot using the built in screen capture. Any hints or sample code would be greatly appreciated.

Upvotes: 4

Views: 5034

Answers (2)

Krish
Krish

Reputation: 437

There are two ways you can try,

  • Using Eclipse

Open the Devices view in Eclipse ( Window Menu --> Show View Option --> Other, Android --> Devices), and there's a toolbar button on the right side labeled Screen Capture

  • Using Android Code

    Bitmap bitmap;
    View v1 = MyView.getRootView();
    v1.setDrawingCacheEnabled(true);
    bitmap = Bitmap.createBitmap(v1.getDrawingCache());
    v1.setDrawingCacheEnabled(false);
    

Upvotes: 13

RajaReddy PolamReddy
RajaReddy PolamReddy

Reputation: 22493

Click on DDMS select emulator from left side and then click on Camera icon.. and then save into your pc..

Upvotes: 2

Related Questions