08-16 17:37:37.694: ERROR/InputDispatcher(61): channel '40803d28 com.myApp.android/com.myApp.android.PickActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
08-16 17:37:37.694: ERROR/InputDispatcher(61): channel '40803d28 com.myApp.android/com.myApp.android.PickActivity (server)' ~ Channel is unrecoverably broken and will be disposed!有时我也会看到这条消息。
08-16 17:44:21.092: ERROR/InputDispatcher(61): Received spurious receive callback for unknown input channel. fd=177, events=0x8所以这只发生在2.3.3的模拟器上,而不是3.0或2.2,或者我测试过的任何其他模拟器上,甚至在我的Froyo Droid令人难以置信的真实设备上工作得很好。没有错误,什么都没有。
每当我在2.3.3模拟器中打开应用程序的主要活动时,在5-7秒之后,我总是会看到上面的日志消息,活动就会关闭。我不确定这是什么意思。我以前从未见过这种情况。
以下是该活动的一些代码片段。这是应用程序的主要活动,在登录到应用程序时显示给用户,然后用户可以从启动各自活动的4个图标中进行选择。
另外,我猜值得一提的是,这个活动有一个MillenialMedia横幅广告底部,再次获取广告,并在所有其他模拟器和设备上运行良好。
公共类PickActivity扩展了Activity实现的OnClickListener,MMAdListener{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFormat(PixelFormat.RGBA_8888);
setContentView(R.layout.main);
// Instantiate shared preferences
mAppPreferences = PreferenceManager.getDefaultSharedPreferences(this);
mEditor = mAppPreferences.edit();
// Instantiate the views
setupViews();
Hashtable<String, String> map = new Hashtable<String, String>();
map.put("keywords", "shopping,deals,money,coupons,sports");
//include additional metadata or settings in the hashmap
MMAdView adView = new MMAdView(this, MYAPID, MMAdView.BANNER_AD_BOTTOM, 30, map);
adView.setId(123);
FrameLayout adFrameLayout = (FrameLayout)findViewById(R.id.mm_layout);
LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);
adFrameLayout.addView(adView, lp);
}然后我实现了onStart、onStop和onResume。
下面是setupViews方法
private void setupViews() {
yourA = (ImageButton)findViewById(R.id.MA);
yourA.setOnClickListener(this);
yourC = (ImageButton)findViewById(R.id.MC);
yourC.setOnClickListener(this);
yourM = (ImageButton)findViewById(R.id.MM);
yourM.setOnClickListener(this);
yourS = (ImageButton)findViewById(R.id.MS);
yourS.setOnClickListener(this);
//Action bar Help button
helpButton = (ImageButton)findViewById(R.id.ActionHelpButton);
helpButton.setOnClickListener(this);
// Action bar Video button
videoButton = (ImageButton)findViewById(R.id.ActionVideoButton);
videoButton.setVisibility(View.VISIBLE);
videoButton.setOnClickListener(this);
// Footer marquee TextView
footerText = (TextView) findViewById(R.id.FooterMarquee);
}我还在带有日志消息的类中添加了MMAdListener默认方法。
请帮助我找出为什么这只发生在2.3.3模拟器和活动被关闭。
谢谢你的帮助。
发布于 2012-05-07 07:43:00
我也犯了同样的错误。我的应用程序正在调用REST服务,因此添加
<uses-permission android:name="android.permission.INTERNET"></uses-permission>android清单为我修复了这个问题。
发布于 2011-08-17 01:56:49
由于这是一个“虚假的回调”消息,我怀疑它与您注册的MMAdListener有关。
尝试注销(注释掉)监听程序,看看这种情况是否会继续发生。
如果是这样的话,我会试着修复AVD。如果这不起作用,请将其删除并重新生成AVD。
希望这能有所帮助。
发布于 2012-03-01 05:20:38
Benni05通过为activity @AndroidManifest设置android:configChanges=“here”属性找到了一个解决方案方向。它适用于我(在安装了APIlvl.11设备时出现错误)。祝好运!
https://stackoverflow.com/questions/7082663
复制相似问题