project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/Downloader/DownloadActivity.java
author Xeli
Thu, 01 Sep 2011 14:55:31 +0200
branchhedgeroid
changeset 5671 ba4c3a4c8b09
parent 5657 4dad72a8f514
permissions -rw-r--r--
Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5621
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
     1
/*
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
     2
 * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
     3
 * Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com>
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
     4
 *
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
     8
 *
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    12
 * GNU General Public License for more details.
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    13
 *
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    14
 * You should have received a copy of the GNU General Public License
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    15
 * along with this program; if not, write to the Free Software
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    17
 */
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    18
ea796c83ea47 added licenses
Xeli
parents: 5412
diff changeset
    19
5412
ab055114c788 Moved download classes to their own dir and fixed the way the dest dir is being 'build'
Xeli
parents: 5397
diff changeset
    20
package org.hedgewars.mobile.Downloader;
ab055114c788 Moved download classes to their own dir and fixed the way the dest dir is being 'build'
Xeli
parents: 5397
diff changeset
    21
ab055114c788 Moved download classes to their own dir and fixed the way the dest dir is being 'build'
Xeli
parents: 5397
diff changeset
    22
import org.hedgewars.mobile.MainActivity;
ab055114c788 Moved download classes to their own dir and fixed the way the dest dir is being 'build'
Xeli
parents: 5397
diff changeset
    23
import org.hedgewars.mobile.R;
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    24
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    25
import android.app.Activity;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    26
import android.content.ComponentName;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    27
import android.content.Context;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    28
import android.content.Intent;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    29
import android.content.ServiceConnection;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    30
import android.os.Bundle;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    31
import android.os.Handler;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    32
import android.os.IBinder;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    33
import android.os.Message;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    34
import android.os.Messenger;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    35
import android.os.RemoteException;
5671
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    36
import android.preference.PreferenceManager;
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    37
import android.view.View;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    38
import android.view.View.OnClickListener;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    39
import android.widget.Button;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    40
import android.widget.ProgressBar;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    41
import android.widget.TextView;
5671
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    42
import android.widget.Toast;
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    43
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    44
public class DownloadActivity extends Activity{
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    45
	private Messenger messageService;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    46
	private boolean boundToService = false;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    47
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    48
	private TextView progress_sub;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    49
	private ProgressBar progress;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    50
	private Button positive, negative;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    51
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    52
	public static final int MSG_START = 0;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    53
	public static final int MSG_UPDATE = 1;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    54
	public static final int MSG_DONE = 2;
5671
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    55
	public static final int MSG_FAILED = 3;
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    56
	private Handler.Callback messageCallback = new Handler.Callback() {
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    57
		
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    58
		public boolean handleMessage(Message msg) {
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    59
			switch(msg.what){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    60
			case MSG_START:
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    61
				progress.setMax(msg.arg1);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    62
				progress_sub.setText(String.format("%dkb/%dkb\n%s", 0, msg.arg1, ""));
5671
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    63
				positive.setText(R.string.download_background);
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    64
				positive.setOnClickListener(backgroundClicker);
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    65
				negative.setText(R.string.download_cancel);
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    66
				negative.setOnClickListener(cancelClicker);
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    67
				break;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    68
			case MSG_UPDATE:
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    69
				progress_sub.setText(String.format("%d%% - %dkb/%dkb\n%s",(msg.arg1*100)/msg.arg2, msg.arg1, msg.arg2, msg.obj));
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    70
				progress.setProgress(msg.arg1);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    71
				break;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    72
			case MSG_DONE:
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    73
				progress.setProgress(progress.getMax());
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    74
				progress_sub.setText(R.string.download_done);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    75
				
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    76
				positive.setText(R.string.download_back);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    77
				positive.setOnClickListener(doneClicker);
5671
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    78
				
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    79
				negative.setVisibility(View.INVISIBLE);
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    80
				break;
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    81
			case MSG_FAILED:
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    82
				progress.setProgress(progress.getMax());
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    83
				progress_sub.setText(R.string.download_failed);
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    84
				positive.setText(R.string.download_back);
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    85
				positive.setOnClickListener(doneClicker);
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    86
				
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    87
				negative.setText(R.string.download_tryagain);
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
    88
				negative.setOnClickListener(tryAgainClicker);
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    89
				break;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    90
			}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    91
			return false;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    92
		}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    93
	};
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    94
	private Handler messageHandler = new Handler(messageCallback);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    95
	private Messenger messenger = new Messenger(messageHandler);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    96
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    97
	public void onCreate(Bundle savedInstanceState){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    98
		super.onCreate(savedInstanceState);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    99
		setContentView(R.layout.download);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   100
		
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   101
		progress_sub = (TextView)findViewById(R.id.progressbar_sub);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   102
		progress = (ProgressBar)findViewById(R.id.progressbar);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   103
		
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   104
		positive = (Button) findViewById(R.id.background);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   105
		negative = (Button) findViewById(R.id.cancelDownload);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   106
		positive.setOnClickListener(backgroundClicker);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   107
		negative.setOnClickListener(cancelClicker);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   108
		
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   109
	}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   110
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   111
	private OnClickListener backgroundClicker = new OnClickListener(){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   112
		public void onClick(View v){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   113
			finish();
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   114
		}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   115
	};
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   116
	private OnClickListener cancelClicker = new OnClickListener(){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   117
		public void onClick(View v){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   118
			Intent i = new Intent(getApplicationContext(), DownloadService.class);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   119
			i.putExtra("taskID", DownloadService.TASKID_CANCEL);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   120
			startService(i);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   121
			finish();
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   122
		}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   123
	};
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   124
	private OnClickListener doneClicker = new OnClickListener(){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   125
		public void onClick(View v){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   126
			finish();
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   127
			startActivity(new Intent(getApplicationContext(), MainActivity.class));
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   128
		}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   129
	};
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   130
	
5671
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
   131
	private OnClickListener tryAgainClicker = new OnClickListener(){
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
   132
		public void onClick(View v){
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
   133
			bindToService(DownloadService.TASKID_RETRY);
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
   134
		}
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
   135
	};
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
   136
	
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   137
	public void onStart(){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   138
		super.onStart();
5671
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
   139
		bindToService(DownloadService.TASKID_START);
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   140
	}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   141
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   142
	public void onStop(){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   143
		super.onStop();
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   144
		unBindFromService();
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   145
	}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   146
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   147
	private ServiceConnection connection = new ServiceConnection(){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   148
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   149
		public void onServiceConnected(ComponentName name, IBinder service) {
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   150
			messageService = new Messenger(service);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   151
			
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   152
			try{
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   153
				Message msg = Message.obtain(null, DownloadService.MSG_REGISTER_CLIENT);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   154
				msg.replyTo = messenger;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   155
				messageService.send(msg);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   156
				
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   157
			}catch (RemoteException e){}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   158
		}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   159
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   160
		public void onServiceDisconnected(ComponentName name) {
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   161
			messageService = null;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   162
		}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   163
		
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   164
	};
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   165
	
5671
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
   166
	private void bindToService(int taskId){
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   167
		Intent i = new Intent(getApplicationContext(), DownloadService.class);
5671
ba4c3a4c8b09 Check if we need to download and prevent user from reaching the startgame menu because it needs images from the download
Xeli
parents: 5657
diff changeset
   168
		i.putExtra("taskID", taskId);
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   169
		startService(i);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   170
		bindService(new Intent(getApplicationContext(), DownloadService.class), connection, Context.BIND_AUTO_CREATE);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   171
		boundToService = true;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   172
	}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   173
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   174
	private void unBindFromService(){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   175
		if(boundToService){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   176
			boundToService = false;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   177
			unbindService(connection);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   178
		}	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   179
	}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
   180
}