For example, given the following XML located in a file in the res/values directory

<?xml version="1.0" encoding="utf-8"?>
 <item name="host" type="setting"></item>
 <item name="port" type="setting">3000</item>

I can now use the following Java syntax within an Android Activity:

String host = getString( );
int port    = getResources().getInteger( R.setting.port );

創作者 Chi Learning 的頭像
Chi Learning

Chi Learning

Chi Learning 發表在 痞客邦 留言(0) 人氣()