Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.53 KB | None | 0 0
  1. package com.damagedapps.dcedge.services;
  2.  
  3. import android.app.Service;
  4. import android.content.ComponentName;
  5. import android.content.Intent;
  6. import android.content.ServiceConnection;
  7. import android.os.*;
  8. import android.os.Process;
  9. import android.util.Log;
  10. import android.widget.Toast;
  11. import com.damagedapps.dcedge.IDownloadService;
  12. import com.damagedapps.dcedge.custom.DownloadDetails;
  13.  
  14.  
  15. /**
  16.  * Created by IntelliJ IDEA.
  17.  * User: AdamGessel
  18.  * Date: Oct 20, 2010
  19.  * Time: 2:57:04 PM
  20.  */
  21. public class DownloadService extends Service {
  22.  
  23.     private final String TAG = "DCEdgeService";
  24.  
  25.     @Override
  26.     public IBinder onBind(Intent arg0) {
  27.         return mBinder;
  28.     }
  29.  
  30.     private final IDownloadService.Stub mBinder = new IDownloadService.Stub() {
  31.         public void Download(DownloadDetails ui) throws RemoteException {
  32.            Toast.makeText(DownloadService.this,"Testing!!!", Toast.LENGTH_LONG).show();
  33.         }
  34.     };
  35.  
  36.    
  37.     @Override
  38.     public void onCreate() {
  39.         super.onCreate();
  40.         Log.v(TAG, "onCreate() called");
  41.     }
  42.  
  43.     private boolean downloadFile(DownloadDetails dd) {
  44.         Toast.makeText(DownloadService.this,"Download started...", Toast.LENGTH_LONG).show();
  45.         return true;
  46.     }
  47.  
  48.  
  49.     @Override
  50.     public void onDestroy() {
  51.         super.onDestroy();
  52.         Log.v(TAG, "onDestroy() called");
  53.     }
  54.  
  55.     @Override
  56.     public void onStart(Intent intent, int startId) {
  57.         super.onStart(intent, startId);
  58.         Log.v(TAG, "onStart() called");
  59.     }
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement