谁做过用Service下载的示例,并且在notification状态栏显示下载进度!或者谁能把http://www.eoeandroid.com/thread-57762-1-1.html这段代码补充齐了!能知道它的xml和DownloadState是怎么写的!谢谢各位前辈了!
解决方案 »
- 请教关于Google AdMob广告植入的问题
- webview中的页面点击输入框页面会自动放大
- android lisview 在线等
- 在2.3版本中,源码Music播放时杀死这个进程再播放时进度条不刷新!
- 怎么让一个进程退出前台的时候 自动销毁
- 为什么这段代码无法让textview居右?
- 关于Activity和Fragment的疑惑~~~~~~~~~~~~~~~~~~~~~~~妈妈说标题长引人注目~~~~~再长点~~~
- 求大神教怎样编辑一个helloworld的安卓项目啊
- 调试-找不到源
- 2014-12-19T23:36:31+08:00 有没有大虾知道这个时间格式叫啥
- 用定时器显示提示对话框出问题?
- 关于点击事件?
<?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也不行!请各位前辈指点!