1

我已经开发了应用程序来显示数据库中的详细信息列表。数据是从 excel 文件中提取并存储到数据库中的。从 excel 读取内容时,出现错误: java.lang.VerifyError: p41.android.consol.products.StartSectionActivity

我的代码在这里:

公共类 StartSectionActivity 扩展 Activity {

Context context=this;
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    super.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.product);

    try {
        //int resourceId = context.getResources().getIdentifier("p41.android.consol.products:raw/products.xls", null, null);
        //File f = new File(context.getResources().openRawResource(resourceId));
        File excel=new File("p41.android.consol.products:raw/products.xls");

        Workbook book=Workbook.getWorkbook(excel);
        Sheet sheet1=book.getSheet(0);
        Cell a1=sheet1.getCell(0, 0);
        Log.d("Cell Value!", a1.getContents());
        /*String files[]=getResources().getAssets().list(null);

        Log.d("files", files[0]);*/
        //InputStream stream=getResources().getAssets().open("PRODUCT_MASTER.xls");


    } catch (BiffException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

}

4

0 回答 0