I need to take a screenshot of Activity
(without the title bar, and the user should NOT see that a screenshot has actually been taken) and then share it via an action menu button "share". I have already tried some solutions, but they didn't work for me. Any ideas?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
for taking screenshot
for saving screenshot
and for sharing
and simply in the
onclick
you can call these methodsSave your time and use this android library
Why should use InstaCapture?
It captures all of the content in your app screen and avoids:
Black screenshot for views like: Google Maps (MapView, SupportMapFragment), TextureView , GLSurfaceView
Missed views like: Dialogs, context menus, toasts
Set a specific view(s) to prevent it from capturing.
No permissions are required.
create share button with click on listener
Add two methods
Share screen shot. sharing implementation here
You can the below code to get the bitmap for the view you are seeing on screen You can specify which view to create bitmap.
For all the Xamarin Users:
Xamarin.Android Code:
Create an external Class (I have an interface for each platform, and I implemented those 3 below functions from android platform):
Now, from your Activity, you run the above code like this:
Hope it will be of use to anyone.
You can take screenshot of any portion of your view.You just need the reference of the layout of which you want the screenshot. for example in your case you want the screen shot of your activity. let assume that your activity root layout is Linear Layout .