[自由讨论] 这是android1.1和android2.1的区别吗?
struts_2010
2010-12-28
用Intent 实现跳转到另一个Activity:
我用android2.1,以下代码硬是无法跳(但用1.1的可以): //这只是处理事件Onclick中的一段代码,下同: setTitle("学习Toast"); Intent intent = new Intent(ActivityMain.this,ActivityToast.class); startActivity(intent); 我用android2.1,这样就可以: Intent intent = new Intent(); intent.setClass(HelloActivity.this, HelloIntent.class); startActivity(intent); 菜鸟... ... 求解 ![]() |
|
dongya1987
2010-12-28
看log
|
|
struts_2010
2010-12-29
额... ... 控制台不报错,就是讲无法找到下一个要跳转的Activity
|
|
dongya1987
2010-12-29
你的代码一个跳转到ActivityToast.class,一个跳转到HelloIntent.class,是笔误还是有意为之?
|
|
struts_2010
2010-12-29
哦,抱歉,我没说明白,
![]() 我分别,使用的是一个工程下的两个Activity跳转 ![]() |
|
dongya1987
2010-12-30
Manifest文件中是否注册了ActivityToast.class
|
|
struts_2010
2010-12-30
<activity android:name=".ActivityMain" android:label="主界面"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".ActivityToast" android:label="Toast界面"> </activity> 这是我的清单文件... ... 里面的部分注册代码 另外,当我第二次导入这个工程后,编译正常,当一运行 便报出- myAndroid_toastAndNotification] Could not find myAndroid_toastAndNotification.apk!这个错误.... .... ![]() |
|
struts_2010
2010-12-31
![]() ![]() 额.... ... 我真的太菜了,我用错了XML文件,编译时有没报错.... 所以纠结了这么久 ![]() |