android - program is working fine but eclipse is showing warning for textview -


i know why eclipse showing warning "[i18n] hardcoded string "textview", should use @string resource" in xml code below .actually trying text written user in edit text in activity current activity.

<?xml version="1.0" encoding="utf-8"?>     <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:orientation="vertical" >          <textview             android:id="@+id/textview1"             android:layout_width="match_parent"             android:layout_height="0dip"             android:layout_weight="0.01"             android:text="textview" />      </linearlayout> 

as says, using "hard-coded" string less efficient using string resource. remove

android:text="textview" 

if don't want warning show. if want there disregard warning or add string resource file. text property isn't needed. if expecting user input should change edittext anyway unless have reason using textview

<edittext         android:id="@+id/textview1"         android:layout_width="match_parent"         android:layout_height="0dip"         android:layout_weight="0.01" /> 

then if want display such "enter input here" in view can add android:hint"text display". give same warning if don't add strings.xml , use android:hint="@string/nameinstringsfile".

but these warnings that. suggesting possibly more efficient methods or ways of implementing whatever doing.


Comments