ファイルのプロパティを読み取り、それに応じてリストボックスのチェックボックスとリスト値を有効/無効にすると、GUI がちらつきます。コードを読んでいるこのファイルを削除すると、GUI がちらつきません。
OnCreate() で設定を作成する前に、プロパティを読んでいます。参照用にファイル書き込みコードを以下に添付します。設定ステータスを読み取って更新する他の方法がある場合はお知らせください。
private void SetExtendConf(String key, String strValue)
{
mProperties = new Properties();
try {
File file = new File(FILE_EXT);
if(!file.exists())
file.createNewFile();
file.setWritable(true,false);
FileInputStream fis = new FileInputStream(file);
mProperties.load(fis);
fis.close();
FileOutputStream stream = new FileOutputStream(file);
Log.d(TAG, "Setting Values " + key + ":"+ strValue);
mProperties.setProperty(key, strValue);
mProperties.store(stream,"ext.conf");
stream.close();
} catch (IOException e) {
Log.d(TAG, "Could not open properties file: " + GPS_FILE_EXT);
}
}
-マノジ