活动拒绝开始

Activity refuses to start(活动拒绝开始)
本文介绍了活动拒绝开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我的第一个 Activity 显示正常,但单击按钮不会调出下一个 Activity.我单步执行了这段代码:

Now my first Activity is displaying fine, but clicking the button does not bring up the next Activity. I stepped through this code:

@Override
public void onClick(View v) {
Intent configure = new  Intent(OnDemandAndAutomatic_Activity.this, Configure_Activity.class);  
OnDemandAndAutomatic_Activity.this.startActivity(configure);
}

...它似乎运行良好,但什么也没发生,除了让我进入调试透视图,在控制台窗格中使用这种措辞:

...and it seemed to run fine, but nothing happened, except breaking me into the Debug Perspective, with this verbiage in the Console pane:

[2012-02-01 21:01:35 - ddms] execute: returning
[2012-02-01 21:01:35 - Unexpected error while launching logcat. Try reselecting the device.] device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
    at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)
    at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
    at com.android.ddmlib.Device.executeShellCommand(Device.java:372)
    at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:100)
    at java.lang.Thread.run(Unknown Source)"

...关于可能导致此问题的任何想法?

...any ideas on what might cause this?

更新:我还尝试将按钮点击代码更改为:

Update: I also tried changing the button click code to this:

Intent configure = new  Intent(this, Configure_Activity.class);  
startActivity(configure);

...但没有区别.

控制台最后一行是:

[2012-02-01 21:31:46 - ddms] Forwarding client reply 0x166 to [Debugger 8647-->390 active]

LogCat 中什么都没有...?!

There is nothing in LogCat...?!

推荐答案

该死的我的尸体!

问题是我忽略了将要启动的 Activity 添加到 Manifest!

The problem was I had neglected to add the Activity to be started to the Manifest!

请原谅我去,无情地责备自己.

Excuse me while I go and berate myself mercilessly.

实际上,我很高兴意识到我的严重错误.

Actually, I'm just happy to have realized my egregious blunder.

这篇关于活动拒绝开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)