Im just asking you a simple question to you experts because i just started studying android basics.
I tried to create a table view and display some strings in it.
i write the xml like this but im getting some warnings “I18N] Hardcoded string “Open…”, should use @string
resource”
when a string is declared.
<TableRow>
<TextView
android:layout_column="1"
android:text="hello"
android:padding="3dip" />
<TextView
android:text="helloo"
android:gravity="right"
android:padding="3dip" />
</TableRow>
<TableRow>
<TextView
android:layout_column="1"
android:text="how"
android:padding="3dip" />
<TextView
android:text="Ctrl-Shift-S"
android:gravity="right"
android:padding="3dip" />
</TableRow>
<View
android:layout_height="2dip"
android:background="#FF909090" />
<TableRow>
<TextView
android:text="are"
android:padding="3dip" />
<TextView
android:text="you"
android:padding="3dip" />
</TableRow>
Can you please help me please.Thanks in advance.
Strings should go to the
res/values/strings.xmlfile which could look like this:Applications can be localized easily: In Eclipse, right-click the res folder, select Android XML Values File, click next. Enter strings.xml, click next. Now you can add various options like language or network code.
Now you can reference your strings using
@string/ctrl-shift-s.Or, within Java code,
R.string.ctrl-shift-s.The
@+id/xyzcreates an ID so you can get the view from code.All resources are being added to the
Rclass automatically.