给出的例子产生一个异常(android.content.ActivityNotFoundException:无活动办理意向)
意向书我=新的意图(AlarmClock.ACTION_SET_ALARM);
i.putExtra(AlarmClock.EXTRA_MESSAGE,新报警);
i.putExtra(AlarmClock.EXTRA_HOUR,小时);
i.putExtra(AlarmClock.EXTRA_MINUTES,分钟);
startActivity(ⅰ);
在我SGS2 Android版本2.3.3。你有什么想法,有什么可以去错了吗?一个又一个的意图请求(例如选择从地址簿中的联系人)正常工作。
感谢您, Artjom
解决方案你有什么想法,有什么可以去错了吗?
本设备不支持该活动。这不是闻所未闻的。无论是捕获异常,并让用户知道,或者使用 PackageManager
和 queryIntentActivities()
来看看是否有什么将响应你的意图
提前调用的 startActivity()
。
The given example produces an Exception (android.content.ActivityNotFoundException: No Activity found to handle Intent)
Intent i = new Intent(AlarmClock.ACTION_SET_ALARM);
i.putExtra(AlarmClock.EXTRA_MESSAGE, "New Alarm");
i.putExtra(AlarmClock.EXTRA_HOUR, hours);
i.putExtra(AlarmClock.EXTRA_MINUTES, mins);
startActivity(i);
on my SGS2 Android Version 2.3.3. Do you have any ideas, what can be going wrong? An another intent request (e.g. selecting a contact from the address book) works fine.
Thank you, Artjom
解决方案Do you have any ideas, what can be going wrong?
The device does not support that activity. This is not unheard of. Either catch the exception and let the user know, or use PackageManager
and queryIntentActivities()
to see if anything will respond to your Intent
in advance of calling startActivity()
.
上一篇:为什么安卓模拟器的编号类似5554模拟器、类似、编号
下一篇:"找不到com_facebook_android.apk错误"当运行Android项目找不到、错误、项目、QUOT