前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >Android: couldn't save which view has focus because the focused view ### has no id

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

作者头像
阳光岛主
发布2019-02-19 18:03:02
发布2019-02-19 18:03:02
5050
举报
文章被收录于专栏:米扑专栏米扑专栏

问题:

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

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2012年02月21日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档