点击下载按钮,通知用户下载任务已添加到下载列表中
布局文件如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:background="@drawable/page"
android:layout_height="wrap_content" android:orientation="vertical">
<Button android:id="@+id/down"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="下载文件"/>
<Button android:id="@+id/newdown"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="新建下载任务"/>
</LinearLayout>
主程序代码: