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

在把pro.android的包放到ios工程项目之后,编译文件,出现了上面的这个问题。

我使用了下面方案一的解决办法解决了这个问题。


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

解决方案一:

<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…











更多相关文章

  1. fedroa16 编译android 4.0.1
  2. Unable to load script.Make sure you're either running a metr
  3. 【odroid-xu3】 ODROID-XU3软件环境搭建记录
  4. Android(安卓)Studio 编译系统源码
  5. AndroidStudio3.5.1下搭建FFmpeg环境
  6. Andriod(三):配置文件build.gradle与AndroidManifest.xml
  7. Android工程Debug证书过期解决方案 -- eclipse
  8. 解决Android编译时无法匹配到AVD的问题
  9. GmSSL Android端 :使用Android(安卓)Studio 调试Native

随机推荐

  1. android studio 配置checkstyle
  2. (OK) 编译batman-adv.ko—成功—android
  3. android app 与电脑wifi通信
  4. Android中保存Logcat信息到文件
  5. android EditText 只能输入无法删除的解
  6. Android(安卓)获取内存、内部存储、外部
  7. Android menu 使用初步
  8. [置顶] 基于Android2.3.5系统:Java JDK AD
  9. Android 图形用户界面 之 绘图(一)
  10. android解析生成xml文件