2017-05-16 74 views
-2

當我運行並在模擬器中安裝我的應用程序時,它工作正常。然後,我關閉應用程序,並開始下次它開始崩潰。 我曾嘗試閱讀不同的問題,但沒有幫助我爲什麼我的應用在首次推出後崩潰?

程序讀取EPUB/FB2文件,並在屏幕上顯示

對不起,我聯繫,但我正常不能格式代碼和問題是有錯誤

的堆棧跟蹤是

Process: net.textreaderfb2epub, PID: 6609 
    java.lang.RuntimeException: Unable to start activity ComponentInfo{net.textreaderfb2epub/net.textreaderfb2epub.fileBrowser.FileBrowser}: android.content.ActivityNotFoundException: Unable to find explicit activity class {net.textreaderfb2epub.textReader/net.textreaderfb2epub.textReader.TextReader}; have you declared this activity in your AndroidManifest.xml? 
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) 
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
     at android.app.ActivityThread.access$800(ActivityThread.java:135) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:136) 
     at android.app.ActivityThread.main(ActivityThread.java:5017) 
     at java.lang.reflect.Method.invokeNative(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:515) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
     at dalvik.system.NativeStart.main(Native Method) 
    Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {net.textreaderfb2epub.textReader/net.textreaderfb2epub.textReader.TextReader}; have you declared this activity in your AndroidManifest.xml? 
     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1628) 
     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424) 
     at android.app.Activity.startActivityForResult(Activity.java:3424) 
     at android.app.Activity.startActivityForResult(Activity.java:3385) 
     at android.app.Activity.startActivity(Activity.java:3627) 
     at android.app.Activity.startActivity(Activity.java:3595) 
     at net.textreaderfb2epub.fileBrowser.FileBrowser.onCreate(FileBrowser.java:115) 
     at android.app.Activity.performCreate(Activity.java:5231) 
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)  
     at android.app.ActivityThread.access$800(ActivityThread.java:135)  
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)  
     at android.os.Handler.dispatchMessage(Handler.java:102)  
     at android.os.Looper.loop(Looper.java:136)  
     at android.app.ActivityThread.main(ActivityThread.java:5017)  
     at java.lang.reflect.Method.invokeNative(Native Method)  
     at java.lang.reflect.Method.invoke(Method.java:515)  
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)  
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)  
     at dalvik.system.NativeStart.main(Native Method) ` 

FileBrowser.java
https://pastebin.com/E0SpgnN1

AndroidManifest.xml中
https://pastebin.com/rqnjqrFN

+0

在此處發佈相關代碼和堆棧跟蹤。 –

+0

logcat告訴你發生了什麼,請嘗試學習如何讀取錯誤堆棧跟蹤。您尚未在清單中聲明您的第二個活動(或者您在setClassName()中存在拼寫錯誤.. – Opiatefuchs

+0

在您的問題中直接發佈代碼而不是在PasteBin中,以防PasteBin發生故障時記住縮進首先4空格 –

回答

0

無法找到明確的活動類{net.textreaderfb2epub.textReader/net.textreaderfb2epub.textReader.TextReader};你有沒有在你的AndroidManifest.xml中聲明這個活動?

我敢打賭,您還沒有將您的TextReader活動添加到您的AndroidManifest.xml。嘗試在<application>標記內添加類似內容:

<application ...> 
    <activity android:name=".textReader.TextReader"> 
     <intent-filter> 
      <action android:name="android.intent.action.VIEW" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
     <intent-filter> 
      <!-- Rest of your current intent-filter with data params --> 
     </intent-filter> 
    </activity> 
</application> 
+0

https://pastebin.com/rqnjqrFN Manifest 對不起,發現這個 – vjbone

+0

它仍然崩潰? –

+0

是仍然崩潰 – vjbone

相關問題