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

前端 未结 2 1128
小鲜肉
小鲜肉 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:17

    you cannot use java.awt.* package in Android, use the Android UI elements instead. See related question here

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题