Link resource with @ : Resource « Development « Android






Link resource with @

 

//File:main.xml for layout

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/directions"
    />
</LinearLayout>

//strings.xml for text value


<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="directions">Hello World, appTest!</string>
    <string name="app_name">app.Test</string>
</resources>

   
  








Related examples in the same category