[英]Get all text from online text file and show it all in a TextView
我想从网页上获取所有文本,并将其保存到字符串数组/列表,然后在“视图/活动”中打印。
假设我有网址www.my.url/html.php
,在该页面上是这样的:
保罗
卡罗琳
史蒂夫”
...
...
现在,我希望将它们写在视图/活动中的相同位置。
我有这个简单的活动:
public class PlayerListActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_playerlist);
}
}
而这个XML文件:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#121E26"
tools:context="com.tominocz.stonequestapp.MainActivity"
tools:ignore="MergeRootFrame,ContentDescription,HardcodedText,SpUsage,TextViewEdits,Deprecated,SmallSp" >
</FrameLayout>
这就是我想要的样子。 您认为这可能吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.