嗨,我是Android新手,我创建了2个项目.
现在,我希望在单击按钮时从第一个项目中调用第二个项目中的活动.
第一个项目只处理登录屏幕,当我点击登录按钮时,我需要调用第二个项目中存在的活动.
我在网上搜索,但没有找到任何我理解正确的教程.
嗨,我发现以下错误.
01-30 08:36:47.230: E/dalvikvm(3408): Could not find class 'com.androidhive.googleplacesandmaps.MainActivity',referenced from method org.fluturasymphony.recommendation.LoginActivity$DownloadWebPageTask.doInBackground
01-30 08:36:52.587: E/AndroidRuntime(3408): FATAL EXCEPTION: AsyncTask #1
01-30 08:36:52.587: E/AndroidRuntime(3408): java.lang.RuntimeException: An error occured while executing doInBackground()
01-30 08:36:52.587: E/AndroidRuntime(3408): at android.os.AsyncTask$3.done(AsyncTask.java:299)
01-30 08:36:52.587: E/AndroidRuntime(3408): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
01-30 08:36:52.587: E/AndroidRuntime(3408): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
01-30 08:36:52.587: E/AndroidRuntime(3408): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
01-30 08:36:52.587: E/AndroidRuntime(3408): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
01-30 08:36:52.587: E/AndroidRuntime(3408): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
01-30 08:36:52.587: E/AndroidRuntime(3408): at java.lang.Thread.run(Thread.java:856)
01-30 08:36:52.587: E/AndroidRuntime(3408): Caused by: java.lang.NoClassDefFoundError: com.androidhive.googleplacesandmaps.MainActivity
01-30 08:36:52.587: E/AndroidRuntime(3408): at org.fluturasymphony.recommendation.LoginActivity$DownloadWebPageTask.doInBackground(LoginActivity.java:69)
01-30 08:36:52.587: E/AndroidRuntime(3408): at org.fluturasymphony.recommendation.LoginActivity$DownloadWebPageTask.doInBackground(LoginActivity.java:1)
01-30 08:36:52.587: E/AndroidRuntime(3408): at android.os.AsyncTask$2.call(AsyncTask.java:287)
01-30 08:36:52.587: E/AndroidRuntime(3408): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
01-30 08:36:52.587: E/AndroidRuntime(3408): ... 3 more
我已宣布清单为此.
而我正在调用这样的第二类活动.
Intent loginintent = new Intent("com.androidhive.googleplacesandmaps.MainActivity");
startActivity(loginintent);
这是正确的吗??
最佳答案
原文链接:/android/430785.html