如何获取之前设置的textswitcher中的文本.就像textview.getText()一样.我尝试了以下代码,但没有奏效.
TextSwitcher textSwitcher = (TextSwitcher)findViewById(...); TextView currentlyShownTextView = (TextView) textSwitcher.getCurrentView(); String currentlyShownText = textSwitcher.getText().toString();
解决方法
请参阅
this回答
TextSwitcher twTime = (TextSwitcher) findViewById(R.id.textSwotcher); twTime.setCurrentText("your text"); TextView tv = (TextView) twTime.getCurrentView(); if (tv.getText().toString().length()>0) { //your action here }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。