2010-05-05 55 views

回答

0

把你的.properties文件到/ RES/raw目錄

try { 
    Resources resources = this.getResources(); 
    // Check generated R file for name oy your resource 
    InputStream rawResource = resources.openRawResource(R.raw.resourceFileName); 
    Properties properties = new Properties(); 
    properties.load(rawResource); 
    System.out.println("The properties are now loaded"); 
    System.out.println("properties: " + properties); 
} catch (NotFoundException e) { 
    System.err.println("Did not find raw resource: "+e); 
} catch (IOException e) { 
    System.err.println("Failed to open property file"); 
} 

來源:http://myossdevblog.blogspot.com/2010/02/reading-properties-files-on-android.html