我有以下元素:
<EditText
android:id="@+id/kernelb11"
android:layout_width="@dimen/matrixBoxWidthHeight"
android:layout_height="@dimen/matrixBoxWidthHeight"
android:layout_below="@+id/textView1"
android:layout_margin="@dimen/marginOne"
android:background="@color/white1"
android:gravity="center"
android:inputType="numberSigned"
android:maxLength="2"
android:text="0" >
我正试图用这样的代码检索它,但它返回给我的只是false
:
String name = "kernelb11"
int a = this.getResources().getIdentifier(name, "id", getPackageName());
CharSequence asa = this.getResources().getText(a); //Returning false
String as = (String) this.getResources().getText(a);
由于总体要求,我无法使用findViewById()