活动拒绝启动 [英] Activity refuses to start

查看:93
本文介绍了活动拒绝启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我的第一个活动是显示正常,但点击按钮不会弹出下一个活动。

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);
}

......,似乎一切正常,但除了打破我进入Debug透视图,有了这个措辞在控制台窗格中什么都没有发生,:

...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?

更新: 我也试图改变按钮点击code到这一点:

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

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

...但它没有什么区别。

...but it makes no difference.

在控制台中的最后一行是:

The last line in Console is:

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

有没有在LogCat中......?!

There is nothing in LogCat...?!

推荐答案

荡我愣尸体!

这个问题是我已经忘了添加活动要开始了清单!

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.

这篇关于活动拒绝启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆