Kee*_*son 8 string android textview
我的main.xml布局文件中有一个名为thefact的对象,即TextView.我还有一个名为sharefact的字符串.我想将TextView中的文本保存到sharefact字符串中.我做不到:
sharefact = thefact
Run Code Online (Sandbox Code Playgroud)
或类似的东西,因为它会要求我将sharefact转换为textview.
谢谢!
Tyl*_*eat 34
TextView theFact = (TextView) findViewById(R.id.theFact);
String shareFact = theFact.getText().toString();
Run Code Online (Sandbox Code Playgroud)
kik*_*iki 34
从TextView
退货中获取文本CharSequence
.要转换CharSequence
为String
,使用toString()
函数.
String sharedFact = theFact.getText().toString();
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
61446 次 |
最近记录: |