Android中AsyncTask异步任务使用详细实例(一)

2019-12-10 18:55:23于丽

main.xml如下:

<LinearLayout xmlns:android="http://www.easck.com/apk/res/android"
xmlns:tools="http://www.easck.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="@+id/startButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="开始异步任务" />
<Button
android:id="@+id/cancelButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="取消异步任务" />
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="100"
android:progress="0" />
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="test test" />
</ScrollView>
</LinearLayout>

以上内容是小编给大家介绍的Android中AsyncTask异步任务使用详细实例(一),希望对大家有所帮助!


注:相关教程知识阅读请移步到Android开发频道。