Label in a editbox in android

前端 未结 9 2330
渐次进展
渐次进展 2020-12-14 10:41

My question is, how to put a label in a editBox in android ?

Like for example, i want to put \"To:\" in editbox of a contact picke

9条回答
  •  青春惊慌失措
    2020-12-14 11:21

    You can add like this

    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.home_screen);
    
    EditText edittext = (EditText)getViewById(R.id.edittextid); 
    edittext.setText("To:") 
    }
    

    Then you will see the text when ever you starting the activity.

    I hope it helps....

提交回复
热议问题