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 發表在 痞客邦 PIXNET 留言(0) 人氣()