programmatically set edit text hint in android?

后端 未结 8 1409
再見小時候
再見小時候 2020-12-09 14:39

is there a way to set the text hint displayed inside of an android edittext with java? I would like for my app to be able to display different things in the edittext at diff

相关标签:
8条回答
  • 2020-12-09 15:22

    if you are using actionbarsherlock searchview, this is the best way to set string dynamically

       AutoCompleteTextView searchTextView =
                        (AutoCompleteTextView) mSearchView.findViewById(R.id.abs__search_src_text);
    
    searchTextView.setHint(getResources().getString(R.string.search));
    
    0 讨论(0)
  • 2020-12-09 15:26

    Kotlin

    editText.hint = "Your hint"
    
    0 讨论(0)
提交回复
热议问题