Ejemplo n.º 1
0
 /** json methods */
 protected void requestJSON(PLFileDownloaderListener listener) {
   try {
     if (mURL != null) {
       if (this.isHTTPURL(mURL)) new PLHTTPFileDownloader(mURL, listener).downloadAsynchronously();
       else
         new PLLocalFileDownloader(mView.getActivity().getApplicationContext(), mURL, listener)
             .downloadAsynchronously();
     } else if (mJSONData != null)
       new Thread(new PLDataRunnable(listener, mURL, mJSONData, System.currentTimeMillis()))
           .start();
     else listener.didErrorDownload(mURL, "JSON string is empty", -1, null);
   } catch (Throwable e) {
     PLLog.error("PLJSONLoader::requestJSON", e);
     listener.didErrorDownload(mURL, e.getMessage(), -1, null);
   }
 }
Ejemplo n.º 2
0
 /** Runnable methods */
 @Override
 public void run() {
   mListener.didEndDownload(mURL, mData, System.currentTimeMillis() - mStartTime);
 }