Search code examples
javaandroidandroid-cardview

How to remove a Button View from CardView before generating a bitmap from the CardView?


I have a CardView in the Android Application which can be shared as a bitmap. How can I remove a Button View from that CardView before generating the bitmap? Is that possible?


Solution

  • How are you generating the bitmap. The easiest way is to hide the button by

    setVisibility(GONE);
    

    before generating the bitmap.