我无法解决这个问题,因为1天后,我遇到了当在AsyncTask及其上的postexecute,在意图调用它发生。Android中的Java.lang.NoClassDefFoundError
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
// Dismiss the progress dialog
try {
Intent isplash= new Intent(Splash.this,MainPage.class);
startActivity(isplash);
finish();
} catch (Exception e) {
e.printStackTrace();
}
}
在menefest.xml
<activity android:name=".MainPage"
android:screenOrientation="landscape"></activity>
,面对错误:
Unable to resolve superclass of Lco/test/MainPage; (130)
Link of class 'Lco/test/MainPage;' failed
Could not find class 'co.test.MainPage', referenced from method co.test.Splash$GetData.onPostExecute
VFY: unable to resolve const-class 320 (Lco/test/MainPage;) in Lco/test/Splash$GetData;
和
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: co.test.MainPage
at co.test.Splash$GetData.onPostExecute(Splash.java:1732)
at co.test.Splash$GetData.onPostExecute(Splash.java:1)
at android.os.AsyncTask.finish(AsyncTask.java:602)
at android.os.AsyncTask.access$600(AsyncTask.java:156)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
问题:当调用的意图。为什么这个?我不知道?? 在谷歌上搜索很多时间,但找不到任何合适的解决方案。
你是否在manifest中定义了mainpage.java? – 2015-03-25 08:59:17
@Bixms显示'MainPage'类和清单 – nikis 2015-03-25 09:01:45
不需要将Intent块放在postExecute()中,只是做简单的 – 2015-03-25 09:02:27