问题:

Android: couldn't save which view has focus because the focused view ### has no id



可能引起原因有两种,对应解决方法如下:

解决方案一:

<application

android:icon="@drawable/icon" android:label="@string/app_name" >

<activity

android:label="@string/app_name"

android:configChanges="orientation|keyboardHidden|keyboard|screenLayout"

android:name=".Main" >

<intent-filter >

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>

</application>


解决方案二:

What probably happened is that you created a thread in the surfaceCreated() method but didn’t stop it or get rid of it in the surfaceDestroy() method.

When you didn’t give a theme for the preferences, it took over the whole screen and your old surface was destroyed. But when you specified a dialog-like theme, the old surface was still there because it was visible underneath the preferences.

public void surfaceCreated(SurfaceHolder holder)
{
if (_thread == null ||_thread.getState() == Thread.State.TERMINATED)
{
_thread = new TutorialThread(getHolder(), this);
_thread.setRunning(true);
_thread.start();
}
else
{
_thread.setRunning(true);
_thread.start();
}
}

This solved the problem for me, a thread’s start method cannot be called twice, so I had to reallocate…

http://forums.pragprog.com/forums/138/topics/4085


更多相关文章

  1. Received status code 400 from server: Bad Request解决方案
  2. Android横竖屏切换解决方案
  3. 关于Android启动页全屏的解决方案
  4. Android Studio编译中“png-cruncher_*”异常的解决方案
  5. (亲测有效)Android SDK Manager国内无法更新的解决方案
  6. 关键(一): android不同机型的适配的解决方案之按比例伸缩篇
  7. 在android中ScrollView嵌套ScrollView解决方案
  8. View控件中android:drawablePadding不起作用的原因探究
  9. Android SDK Manager国内无法更新的解决方案(亲测有效)

随机推荐

  1. 13-5-16 Android自定义空间实现wifi信号
  2. Android(安卓)8.0 新特性及开发指南
  3. Android之AsyncTask的内存泄露问题
  4. Android需要大量内存时自己设置堆大小
  5. 第一个Android程序
  6. php实现post请求 接收android客户端json
  7. Android开发---xml布局文件中的常见属性
  8. 大厂面试秘籍—— 深入理解 Handler
  9. 《Android内核剖析》读书笔记 第18章 And
  10. Android(安卓)操作串口 (android serial