In Android GUI flickers when reading the properties file

I am getting the GUI flicker when reading a file properties and accordingly enabling/disabling checkbox and List value in listbox. when i remove this file reading code the GUI doesnt have flicker.

I am reading the properties before creating the Preferences in OnCreate(). Attached the file write code below for reference.Please let us know is there any other way to read and update the preference staus.

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);,"ext.conf"); stream.close(); } catch (IOException e) { Log.d(TAG, "Could not open properties file: " + GPS_FILE_EXT); } }



Why are you instantiating new Properties objects, re-read and re-write the props file for each operation on properties? If theres no actual reason for doing so, just read them once and write them when needed (taking care of onPause/onResume), and do it in a thread, ie:

final Handler handler = new Handler();


Runnable writeProps = new Runnable() {
public void run() {
// do your work here
// run this if you want to notify something to the UI thread
// Runnable() {public void run() { notifyUI(); }});
Thread thread = new Thread(writeProps, "writeProps");


Category:android Time:2011-01-17 Views:1

Related post

  • Android 2.2+ SDK - Properties file in /config not overriding file in .jar 2011-03-10

    I've had this problem with log property files before, but was able to re-bundle the jar (it was my own lib). Now I have a .jar in which the default file is bundled with it (and needed), and in a normal java project, I can put a setup

  • Android: IntelliJ IDEA 10 - Where is the android GUI designer? 2011-04-08

    Am i am missing something, I have the IDEA 10 installed and created an android module. I se my main.xml in layout but it just shows me the XML.. Is it no possible to design a layout using the GUI? Eclipse has this. I am sure i am missing something, a

  • How can I enable Android GUI to unlock SIM PIN after booting? 2011-05-06

    I'm a android RIL driver developer. I had implement "Change SIM PIN" function (RIL write AT command to modem). But when SIM card status is "SIM_PIN" (require PIN code to unlock SIM card), the "Change SIM PIN" function would be failed. How can I enabl

  • android open a .properties file from project 2011-05-17

    I have a file defined next to the, AndroidManifest.xml, called my question is. how do open this file in my class? if i move it to the class package i can read it using the folowing code: Properties configFile

  • Eclipse Android GUI Editor: Show IDs? 2011-06-15

    I am using the eclipse (adt plugin) android gui editor and I am wondering how one can display all the used IDs for the single views at once? Currently Iam looking it up by right clicking and choosing Edit ID, is there an easier way to just always sho

  • Good Android GUI Design Mock Up with transition between Activities- Must be open source 2011-07-11

    I am after a good Android GUI Design Mock Up tool. must be able to demo as a presentation with transition between Activities May have ability to generate xml layout file I am currently using Pencil which is the best at sketching quick mockups but lim

  • Netbeans android plugin is not generating 2011-10-23

    I am using NBAndroid plugin with Netbeans 7.0.1. I don't know nbandroid version. I installed latest couple of days back. When I create a project, it seems to generate all the files except When I build, the build is failing because

  • Exercise: views, layouts and buttons to create android GUI 2012-02-09

    Ok, so I'm pretty noobish to android but starting to get the hang of it. Before I move on I would like to ask for some general feedback for creating android GUI using API views, lists and layouts. For the sake of exercise I will use GUI as an example

  • how to extract web text in android like rss to display it on android GUI? 2012-02-10

    how to extract some criteria from this page and filter this ( content_id , thumbnail, summary , headline , image) to display them as rss feeds in my android GUI --

  • Android:Project has no file! Edit the project properties to set one. works 2012-03-16

    Project has no file! Edit the project properties to set one. works Unknown Android Target Problem This is the error i got on importing a package, wat could be the problem ??? --------------Solutions------------- Your question is no

  • Is it possible to show button states in Eclipse Android Gui builder? 2012-03-20

    I'm designing buttons with selector now. For testing the design I need to run application and Log into the application, navigate to the view and so on ... You know, It is not very comfortable for me. Is it possible to show the button states (for exam

  • save properties file android apps 2012-03-22

    I have a problem to store a properties file in android, this is the code: Properties prop = new Properties(); prop.load(context.getResources().openRawResource(R.raw.config)); Utils.log(context,"db.version =>"+ prop.get("db.version")); prop.setProp

  • Android GUI stack performance metrics 2012-03-24

    We are evaluating different GUI frameworks for an embedded system. What I like to do is run a GUI program that does things like image alpha blending, draw text with different effects, fill rectangles etc and measure its CPU load during these operatio

  • Android GUI update at runtime 2012-04-26

    I have a native method which is called from Java layer and is called successfully. The native method sends two integer values to the java layer at different times, and these values are received successfully in the java layer (to and fro data transfer

  • Creating Android GUI 2014-04-16

    I am quite newbe as Android developer so I would like to ask you about good behaviours when creating Android GUI. Mainly I have a problem with designing GUI using Relative or Linear layout because my GUI is graphical. Developing all dependencies, wha

  • Unable to Locate Properties File Inside Jar During Junit Tests via Ant 2008-12-08

    I am having problems running my Junit tests via Ant. I can't seem to get Ant to see the properties file it needs to load a dll my project needs. All my tests work using the Junit GUI in Elcipse, so I'm pretty sure it's not a problem with the tests th

  • Tool to find duplicate keys and value in properties file 2009-11-22

    is there a tool that tells me redundant keys and values that are there in my one or many properties file. --------------Solutions------------- There is an Ant task, RscBundleCheck, that checks for the existence of duplicate keys in a set of resource

  • Translucent colors in Java through properties files 2010-02-03

    Is it possible to specify a color in a properties file that has an alpha component? When I put a hexadecimal number in the properties file that has an alpha channel, the alpha is ignored. I notice that the decode method of string says "Converts a Str

  • How to read properties file in Greek using Java 2010-05-29

    I am trying to read from a properties file which have keys in English & values in greek.My code is like this: public class I18NSample { static public void main(String[] args) { String language; String country; if (args.length != 2) { language = n

Copyright (C), All Rights Reserved.

processed in 0.625 (s). 13 q(s)