Hello, please tell me why the application crashes when it starts

Here is my class

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent intent = new Intent(getApplicationContext(), FolioActivity.class); intent.putExtra(FolioActivity.INTENT_EPUB_SOURCE_TYPE, FolioActivity.EpubSourceType.RAW); intent.putExtra(FolioActivity.INTENT_EPUB_SOURCE_PATH, R.raw.niga); startActivity(intent); } 

Here are the logs ..

screenshot of logs

  • You have an NPE. Most of the information given by you can not be said. Need more details - YuriySPb

1 answer 1

Most likely, the reader is unable to read your book. If you look at the sources , the mBook field is most likely not initialized in the 164th line. I advise you to FileUtil into the FileUtil class , starting with the saveEpubFile method. Try to do the same with your resource, you may be able to figure out why you cannot access it.