Get bitmap from layout

前端 未结 3 1408
青春惊慌失措
青春惊慌失措 2020-12-05 11:57

I\'m trying to inflate a layout and use that to set a bitmap on an image view. Then, I\'m adding that imageview to a linear layout and displaying the linear layout. Here\'s

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 12:35

    You cant get bitmap on the views or layout is not being inflated.

    Layout will only getting inflated after OnCreate()

    .

    1.Get bitmap on Button_Clicked(View view){}

    2.Or using a Handle()to post delaying your get bitmap

    3.Make sure drawing cache is created using view.buildDrawingCache();

提交回复
热议问题