谁做过用Service下载的示例,并且在notification状态栏显示下载进度!或者谁能把http://www.eoeandroid.com/thread-57762-1-1.html这段代码补充齐了!能知道它的xml和DownloadState是怎么写的!谢谢各位前辈了!
解决方案 »
- android通过摄像头预览、录制视频
- 如果想让自己的网站可以在手机上访问,应该如何入手啊?
- android 怎么利用摄像头扫描文字,获取一张纸片上的文字信息
- android开发 把图片缩小到指定分辨率。
- 关于opengl es中的glReadPixels函数
- 求助:Re-installation failed due to different application signatures
- 开发板_android进程调试
- Eclipse配置Android问题
- android项目访问linux服务器的问题
- Android中surfaceView控件问题
- 用定时器显示提示对话框出问题?
- 关于点击事件?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="@+id/ImageView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Progressbar
android:id="@+id/ProgressBar01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
/>
</LinearLayout>
</LinearLayout>
mList = DownloadState.toList();主要是这句话!没猜到!呵呵~~
其他的看看需要什么就添加什么。
public class DownloadState
{
public String name;
public int fileSize;
public int downSize;
public String url; public static ArrayList<DownloadState> toList; }
这样吗?报错!
DownLoadActivity 下载详情页
MyService Service页,通知状态栏修改状态总体是这样的。
MainActivity -> DownLoadActivity -> MyService分步解释。
(发出指令传递参数要下载,单并不显示DownLoadActiv页
实际已经在DownLoadAcitvity页下载)
1.MainActivity -》 ->DownLoadActivity (发出指令更新状态栏的进度条,有多个并且添加)
2. DownLoadActivity -> MyService但是现在有这样一个问题!MainActivity、DownLoadActivity都是两个Activity,怎么发送消息还不启动DownLoadActivity,DownLoadActivity还能下载。
Intent intent=new Intent(MainActivity.this,DownLoadActivity.class);
startActivity(intent);这样肯定不行!new DownLoadActivity也不行!请各位前辈指点!