我的家園

          我的家園

          問題:

          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



          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 越西县| 峨眉山市| 满城县| 内乡县| 宁都县| 兴仁县| 巴彦淖尔市| 霍山县| 扶沟县| 清水县| 上虞市| 上蔡县| 天全县| 都安| 锡林浩特市| 莱州市| 嘉祥县| 淅川县| 阿尔山市| 临漳县| 虹口区| 翁牛特旗| 甘谷县| 广水市| 长子县| 张掖市| 六安市| 佛坪县| 高密市| 台江县| 黄浦区| 大新县| 芜湖市| 古交市| 鄱阳县| 上杭县| 抚州市| 驻马店市| 榆林市| 马关县| 潼南县|