NoClassDefFoundError when inserting image in Android app using Apache poi & MS Excel

前端 未结 2 1131
小鲜肉
小鲜肉 2020-12-22 02:57

I want to insert a PNG image into my Excel sheet using Apache poi.

To do that I use this code:

//add picture data to this workbook.
InputStream is =          


        
2条回答
  •  情歌与酒
    2020-12-22 03:36

    You can't use pure Java libraries that involve graphics routines (java.awt), because Android hasn't implemented them, as it uses it's own graphics library. Bottom line is, you can't use the library you want with Android, although I'm sure there's other ways to do the task you want to do.

    Android uses a few base types, namely Views, Canvas, and Drawables. Take a look at those, and see if they meet your needs.

提交回复
热议问题