展会信息港展会大全

Android: couldn't save which view has focus because the focused view
来源:互联网   发布日期:2016-01-14 12:37:30   浏览:1727次  

导读:Android: couldn#39;t save which view has focus because the focused view ### has no id可能引起原因有两种,对应解决方法如下:解决方案一:application android:icon=@drawable/ic......

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

赞助本站

人工智能实验室

相关热词: Android: couldn

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港