0

I have some android code (textView, editText, button) and I add all strings in string.xml. I call these data in this way:

Button vibro;          
setVibro((Button) findViewById(R.id.vibro));     
vibro.setText(getString(R.string.vibro_button));            
vibro = (Button)findViewById(R.id.vibro);  

and also I create set and get method for it. This is one part of my main.xml:

<EditText     
    android:id="@+id/editme"       
    android:layout_width="fill_parent"     
    android:layout_height="wrap_content"     
    android:text="@string/username"     
    />        

 <Button     
    android:id="@+id/buttons"      
    android:layout_width="fill_parent"        
    android:layout_height="wrap_content"     
    android:text="@string/bfirst"     
    />

and this is one part of my string.xml:

<string name="bfirst">Register</string>

The problem is that I see the buttons and edit text and everything in all my pages. I am sure that I call them in a correct way. But what can cause a problem?

4

1 回答 1

1

setVibro 是一种方法吗?

另外,尝试设置这一行:

vibro = (Button)findViewById(R.id.vibro);

在此行之前:

vibro.setText(getString(R.string.vibro_button));

于 2012-04-11T00:31:39.300 回答