Java Android OnClick侦听器似乎无法正常工作

Java Android OnClick侦听器似乎无法正常工作,java,android,layout,onclick,onclicklistener,Java,Android,Layout,Onclick,Onclicklistener,我已经构建了一个应用程序,它应该使用HttpURLConnection从web下载数据。我使用了以下教程/示例: 正如StackOverflow成员就我使用JSoup提取HTML数据时遇到的一个问题提出的建议: 我的问题是-我遵循了教程,所有的东西都编译了,没有错误-但是当我尝试运行应用程序时-在我输入了一个我想从中提取数据的网址后-应用程序说它已经将数据保存到sd卡-但是每次我浏览到文件夹时-它都是空的 资料来源: 主要活动: public class MainActivity e

我已经构建了一个应用程序,它应该使用HttpURLConnection从web下载数据。我使用了以下教程/示例:

正如StackOverflow成员就我使用JSoup提取HTML数据时遇到的一个问题提出的建议:

我的问题是-我遵循了教程,所有的东西都编译了,没有错误-但是当我尝试运行应用程序时-在我输入了一个我想从中提取数据的网址后-应用程序说它已经将数据保存到sd卡-但是每次我浏览到文件夹时-它都是空的

资料来源:

主要活动:

    public class MainActivity extends Activity {

    private ListView lv;
    private ArrayList<String> urlist;
    private ArrayAdapter<String> aa;
    private String storeDir;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        urlist=new ArrayList<String>();
        aa=new ArrayAdapter<String>(this,R.layout.listlayout,urlist);
        lv=(ListView)findViewById(R.id.url_list);
        lv.setAdapter(aa);
        Intent intent=getIntent();
        String action=intent.getAction();       
        if(Intent.ACTION_VIEW.equals(action)){         
          Uri uri=intent.getData();
          EditText txturl=(EditText)findViewById(R.id.txt_input);
          txturl.setText(uri.toString());

        }


    }

    protected void onStart(){
     super.onStart();
     createStoreDir();
    }

    protected void onResume(){
     super.onResume();
     registerReceiver(receiver, new IntentFilter("com.example.webdownloader"));     
    }

    protected void onPause(){
     super.onPause();
     unregisterReceiver(receiver);


    }

    private BroadcastReceiver receiver=new BroadcastReceiver(){
     public void onReceive(Context context,Intent intent){

            Bundle b=intent.getExtras();
            if(b!=null){
             TextView tv=(TextView)findViewById(R.id.txt_view);
             tv.setText(b.getString("BACKMESS"));
            }
     }
    };


    public void createStoreDir(){
     storeDir=Environment.getExternalStorageDirectory()+"/webdownload";
     File f=new File(storeDir);
     if(!f.exists())
         if(!f.mkdir()){
           Log.e("Error","Can't create webdownload directory");
           disableButtons();
        }
    }

    public void disableButtons(){
     Button btadd=(Button)findViewById(R.id.bt_add);
     Button btok=(Button)findViewById(R.id.bt_ok);
     btadd.setEnabled(false);
     btok.setEnabled(false);
    }
//    public boolean onCreateOptionsMenu(Menu menu) {
//        // Inflate the menu; this adds items to the action bar if it is present.
//        getMenuInflater().inflate(R.menu.main, menu);
//        return true;
//    }

    public void addClick(View view){
     EditText txturl=(EditText)findViewById(R.id.txt_input);
     String url=txturl.getText().toString();
     if(url.length()>0){
      urlist.add(url);
      aa.notifyDataSetChanged();
     }
    }
    public void okClick(View view){
     TextView tv=(TextView)findViewById(R.id.txt_view);
     tv.setText("Please wait...");
     Intent newIntent=new Intent(this,DownloadService.class);
     newIntent.putStringArrayListExtra("URLS", urlist);
     newIntent.putExtra("OUTDIR",storeDir);     
     startService(newIntent);

    }

}
公共类MainActivity扩展活动{
私有ListView lv;
私人ArrayList urlist;
私人阵列适配器aa;
私有字符串storeDir;
创建时受保护的void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
urlist=newarraylist();
aa=新的ArrayAdapter(this,R.layout.listlayout,urlist);
lv=(ListView)findViewById(R.id.url\u列表);
低压设置适配器(aa);
Intent=getIntent();
String action=intent.getAction();
如果(Intent.ACTION_VIEW.equals(ACTION)){
Uri=intent.getData();
EditText txturl=(EditText)findViewById(R.id.txt_输入);
txturl.setText(uri.toString());
}
}
受保护的void onStart(){
super.onStart();
createStoreDir();
}
受保护的void onResume(){
super.onResume();
registerReceiver(接收器,新的IntentFilter(“com.example.webdownloader”);
}
受保护的void onPause(){
super.onPause();
未注册接收人(接收人);
}
private BroadcastReceiver=新的BroadcastReceiver(){
公共void onReceive(上下文、意图){
Bundle b=intent.getExtras();
如果(b!=null){
TextView tv=(TextView)findViewById(R.id.txt\u视图);
tv.setText(b.getString(“BACKMESS”);
}
}
};
public void createStoreDir(){
storeDir=Environment.getExternalStorageDirectory()+“/webdownload”;
文件f=新文件(storeDir);
如果(!f.exists())
如果(!f.mkdir()){
Log.e(“错误”,“无法创建Web下载目录”);
禁用按钮();
}
}
公共无效禁用按钮(){
按钮btadd=(按钮)findviewbyd(R.id.bt\u add);
按钮btok=(按钮)findViewById(R.id.bt_ok);
btadd.setEnabled(false);
btok.setEnabled(false);
}
//公共布尔onCreateOptions菜单(菜单){
////对菜单进行充气;如果存在,则会将项目添加到操作栏中。
//getMenuInflater().充气(R.menu.main,menu);
//返回true;
//    }
公共void addClick(视图){
EditText txturl=(EditText)findViewById(R.id.txt_输入);
字符串url=txturl.getText().toString();
如果(url.length()>0){
添加(url);
aa.notifyDataSetChanged();
}
}
公共作废OK单击(查看){
TextView tv=(TextView)findViewById(R.id.txt\u视图);
tv.setText(“请稍候…”);
Intent newIntent=newIntent(这是DownloadService.class);
putStringArrayListExtra(“URL”,URL列表);
newIntent.putExtra(“OUTDIR”,storeDir);
startService(newIntent);
}
}
下载服务:

public class DownloadService extends IntentService {
 private ArrayList<String> urlist;
 private String storeDir;
 public DownloadService() {
  super("SERVICE");
  // TODO Auto-generated constructor stub
 }

 public void onHandleIntent(Intent intent){
  Bundle b=intent.getExtras();  
  if(b!=null){
   urlist=b.getStringArrayList("URLS");
   storeDir=b.getString("OUTDIR");
   startDownload();
  }


 }

 public void startDownload(){
  String feedback="";
  if(urlist.size()>0){
  try {
   for(int i=0;i<urlist.size();i++){        

    URL url=new URL(urlist.get(i));
    readDataStream(url); 

   }

   feedback="Complete! Check the webdownload directory on your sdcard";

   } catch (MalformedURLException e) { e.printStackTrace();}
  }
  else{

   feedback="No url is added to the download list.";
  }
  //send feedback message to the main activity
  Intent backIntent=new Intent("com.example.webdownloader");
  backIntent.putExtra("BACKMESS", feedback);  
  sendBroadcast(backIntent);

 }
 public void readDataStream(URL url){
     try {

      File f=new File(storeDir);
      if(f.exists()){
       HttpURLConnection con=(HttpURLConnection)url.openConnection();
       InputStream is=con.getInputStream();
       String path=url.getPath();
       String filename=path.substring(path.lastIndexOf('/')+1);   
       FileOutputStream fos=new FileOutputStream(storeDir+"/"+filename);
       int data=0;
       while((data=is.read())!=-1){
        fos.write(data);
       }
       is.close();
       fos.flush();
       fos.close();
      }
      else
       Log.e("Error","Not found "+storeDir);

  } catch (IOException e) {
   e.printStackTrace();
  }

    }
}
公共类下载服务扩展了IntentService{
私人ArrayList urlist;
私有字符串storeDir;
公共下载服务(){
超级(“服务”);
//TODO自动生成的构造函数存根
}
处理内容上的公共无效(意图){
Bundle b=intent.getExtras();
如果(b!=null){
urlist=b.getStringArrayList(“URL”);
storeDir=b.getString(“OUTDIR”);
startDownload();
}
}
public void startDownload(){
字符串反馈=”;
如果(urlist.size()>0){
试一试{

对于(int i=0;iDid您在
Logcat中查找
Log.e(“错误”,“无法创建Web下载目录”);
行?
File.mkdir()
如果目录已经存在,也将返回
false
。我很抱歉-我在模拟器上运行了它-我在手机上运行了它,它的行为略有不同(查看我上面更新的帖子)我也发布了我的日志,并将
http://
添加到您的URL?09-20 11:13:33.562:W/System.err(29261):java.net.MalformedURLException:找不到协议:www.google.com似乎您需要将“http://”添加到“www.google.com”谢谢!我在URL中添加了一个http://按钮,现在我可以点击按钮了——上面说这是成功的,但当我通过手机浏览到文件夹时,我在文件夹webdownload中没有看到任何数据——知道为什么会发生这种情况吗?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:orientation="vertical"

>

<EditText
android:id="@+id/txt_input"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="@string/txt_hint"
/> 
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" 
android:orientation="horizontal"
>
<Button
android:id="@+id/bt_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bt_label" 
android:onClick="addClick"
/>
<Button
android:id="@+id/bt_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bt_ok" 
android:onClick="okClick"
/>
</LinearLayout>
<TextView 
android:id="@+id/txt_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<ListView
android:id="@+id/url_list"
android:layout_width="fill_parent"
android:layout_height="300dp"
android:paddingBottom="20dp"
android:paddingTop="20dp"
android:background="#f8f8f8" 
/> 

</LinearLayout>
09-20 11:13:27.856: E/SpannableStringBuilder(29261): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
09-20 11:13:27.866: E/SpannableStringBuilder(29261): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
09-20 11:13:29.368: W/InputEventReceiver(29261): Attempted to finish an input event but the input event receiver has already been disposed.
09-20 11:13:29.368: W/InputEventReceiver(29261): Attempted to finish an input event but the input event receiver has already been disposed.
09-20 11:13:33.562: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:33.562: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:33.562: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:33.562: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:33.562: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:33.562: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:33.562: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:33.562: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:33.562: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:37.196: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:37.196: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:37.196: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:37.196: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:37.196: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:37.196: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:37.196: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:37.196: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:37.196: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:39.719: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:39.719: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:39.719: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:39.719: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:39.719: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:39.719: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:39.719: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:39.719: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:39.719: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:40.970: E/SpannableStringBuilder(29261): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
09-20 11:13:40.970: E/SpannableStringBuilder(29261): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
09-20 11:13:42.192: W/InputEventReceiver(29261): Attempted to finish an input event but the input event receiver has already been disposed.
09-20 11:13:44.875: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:44.875: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:44.875: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:44.875: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:44.875: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:44.875: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:44.875: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:44.875: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:44.875: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:45.495: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:45.495: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:45.495: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:45.495: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:45.495: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:45.495: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:45.495: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:45.495: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:45.495: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:45.786: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:45.786: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:45.786: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:45.786: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:45.796: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:45.796: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:45.796: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:45.796: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:45.796: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:45.996: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:45.996: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:45.996: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:45.996: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:45.996: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:45.996: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:45.996: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:45.996: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:45.996: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:47.337: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:47.337: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:47.337: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:47.337: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:47.337: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:47.337: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:47.337: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:47.337: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:47.337: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:47.888: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:47.888: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:47.888: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:47.888: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:47.888: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:47.888: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:47.888: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:47.888: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:47.888: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:48.468: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:48.468: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:48.468: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:48.468: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:48.468: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:48.468: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:48.468: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:48.468: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:48.468: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:49.019: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:49.019: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:49.019: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:49.019: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:49.019: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:49.019: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:49.019: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:49.019: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:49.019: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:49.540: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:49.540: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:49.540: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:49.540: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:49.540: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:49.540: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:49.540: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:49.540: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:49.540: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:49.970: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:49.970: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:49.970: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:49.970: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:49.970: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:49.980: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:49.980: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:49.980: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:49.980: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:50.170: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:50.170: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:50.170: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:50.170: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:50.170: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:50.170: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:50.170: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:50.170: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:50.170: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:50.380: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:50.380: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:50.380: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:50.380: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:50.380: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:50.380: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:50.380: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:50.380: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:50.380: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:50.951: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:50.951: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:50.951: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:50.951: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:50.951: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:50.951: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:50.961: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:50.961: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:50.961: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:52.282: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:52.282: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:52.282: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:52.282: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:52.282: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:52.282: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:52.282: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:52.282: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:52.282: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)
09-20 11:13:52.523: W/System.err(29261): java.net.MalformedURLException: Protocol not found: www.google.com
09-20 11:13:52.523: W/System.err(29261):    at java.net.URL.<init>(URL.java:178)
09-20 11:13:52.523: W/System.err(29261):    at java.net.URL.<init>(URL.java:127)
09-20 11:13:52.523: W/System.err(29261):    at com.example.webdownloader.DownloadService.startDownload(DownloadService.java:40)
09-20 11:13:52.523: W/System.err(29261):    at com.example.webdownloader.DownloadService.onHandleIntent(DownloadService.java:28)
09-20 11:13:52.523: W/System.err(29261):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
09-20 11:13:52.523: W/System.err(29261):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 11:13:52.533: W/System.err(29261):    at android.os.Looper.loop(Looper.java:137)
09-20 11:13:52.533: W/System.err(29261):    at android.os.HandlerThread.run(HandlerThread.java:60)