()
| 1058 | public boolean isStarted() { return mIsStarted; } |
| 1059 | |
| 1060 | @Override |
| 1061 | protected void onStart() { |
| 1062 | log.i("CoolReader.onStart() fileToLoadOnStart=" + fileToLoadOnStart); |
| 1063 | super.onStart(); |
| 1064 | |
| 1065 | mPaused = false; |
| 1066 | |
| 1067 | backlightControl.onUserActivity(); |
| 1068 | |
| 1069 | // Donations support code |
| 1070 | if (billingSupported) |
| 1071 | ResponseHandler.register(mPurchaseObserver); |
| 1072 | |
| 1073 | if (!isFirstStart) |
| 1074 | return; |
| 1075 | isFirstStart = false; |
| 1076 | |
| 1077 | if ( fileToLoadOnStart==null ) { |
| 1078 | if ( mReaderView!=null && currentView==mReaderView && mReaderView.isBookLoaded() ) { |
| 1079 | log.v("Book is already opened, showing ReaderView"); |
| 1080 | showReader(); |
| 1081 | return; |
| 1082 | } |
| 1083 | |
| 1084 | //!stopped && |
| 1085 | // if ( restarted && mReaderView!=null && mReaderView.isBookLoaded() ) { |
| 1086 | // log.v("Book is already opened, showing ReaderView"); |
| 1087 | // restarted = false; |
| 1088 | // return; |
| 1089 | // } |
| 1090 | } |
| 1091 | if ( !stopped ) { |
| 1092 | mEngine.showProgress( 500, R.string.progress_starting_cool_reader ); |
| 1093 | } |
| 1094 | //log.i("waiting for engine tasks completion"); |
| 1095 | //engine.waitTasksCompletion(); |
| 1096 | // restarted = false; |
| 1097 | stopped = false; |
| 1098 | final String fileName = fileToLoadOnStart; |
| 1099 | mBackgroundThread.postGUI(new Runnable() { |
| 1100 | public void run() { |
| 1101 | log.i("onStart, scheduled runnable: submitting task"); |
| 1102 | mEngine.execute(new LoadLastDocumentTask(fileName)); |
| 1103 | } |
| 1104 | }); |
| 1105 | log.i("CoolReader.onStart() exiting"); |
| 1106 | } |
| 1107 | |
| 1108 | class LoadLastDocumentTask implements Engine.EngineTask { |
| 1109 |
nothing calls this directly
no test coverage detected