screenshott icon indicating copy to clipboard operation
screenshott copied to clipboard

I can not use library

Open sinaf2000 opened this issue 6 years ago • 1 comments

hi I can not use library my code error i make option menu case R.id.shot: Bitmap bitmap_hiddenview = ScreenShott.getInstance().takeScreenShotOfJustView(view); File file = ScreenShott.getInstance().saveScreenshotToPicturesFolder(context, bitmap, "my_screenshot_filename"); String bitmapFilePath = file.getAbsolutePath(); break;

my error = (view) & (context, bitmap,

screenshot 25 @nisrulz please help me Thanks

sinaf2000 avatar Sep 20 '18 16:09 sinaf2000

Looks like you copied the sample code as it is. The red context you have in your screenshot should be replaced by this keyword. For view you need to get a reference to whatever view you want to take the screenshot of. I am guessing you want to take the screenshot of your MainActivity screen. IN that case simply assign an id to your root layout and then reference it as

View view = findViewById(R.id.rootViewId);

and then pass that reference as the argument.

nisrulz avatar Sep 20 '18 19:09 nisrulz