当前位置: 首页>>代码示例>>Java>>正文


Java RequestCallback类代码示例

本文整理汇总了Java中com.google.android.apps.picview.request.AsyncRequestTask.RequestCallback的典型用法代码示例。如果您正苦于以下问题:Java RequestCallback类的具体用法?Java RequestCallback怎么用?Java RequestCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RequestCallback类属于com.google.android.apps.picview.request.AsyncRequestTask包,在下文中一共展示了RequestCallback类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doAlbumsRequest

import com.google.android.apps.picview.request.AsyncRequestTask.RequestCallback; //导入依赖的package包/类
/**
 * Loads the albums for the given user.
 * 
 * TODO: This is Picasa specific.
 */
private void doAlbumsRequest(String userName) {
  // Use text field value.
  PicasaAlbumsUrl url = new PicasaAlbumsUrl(userName);
  AsyncRequestTask request = new AsyncRequestTask(cachedWebRequestFetcher,
      url.getUrl(), false, "Loading albums...", this,
      new RequestCallback() {
        @Override
        public void success(String data) {
          AlbumListActivity.this.albums = Album.parseFromPicasaXml(data);
          Log.d(TAG, "Albums loaded: " + AlbumListActivity.this.albums.size());
          showAlbums();
        }

        @Override
        public void error(String message) {
          Log.e(TAG, "Could not load albums: " + message);
          showError("Error while fetching albums");
        }
      });
  request.execute();
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:27,代码来源:AlbumListActivity.java

示例2: doPhotosRequest

import com.google.android.apps.picview.request.AsyncRequestTask.RequestCallback; //导入依赖的package包/类
private void doPhotosRequest(final String albumTitle, String gdataUrl) {
  AsyncRequestTask request = new AsyncRequestTask(cachedWebRequestFetcher,
      gdataUrl, false, "Loading photos...", this,
      new RequestCallback() {

        @Override
        public void success(String data) {
          showPhotos(albumTitle, Photo.parseFromPicasaXml(data));
        }

        @Override
        public void error(String message) {
          Log.e(TAG, "Could not load photos: " + message);
          showError("Error while fetching photos");
        }
      });
  request.execute();
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:19,代码来源:AlbumListActivity.java

示例3: doAddTagRequest

import com.google.android.apps.picview.request.AsyncRequestTask.RequestCallback; //导入依赖的package包/类
private void doAddTagRequest(String tag, Album album, Photo photo) {
// Use text field value.
PicasaTagsUrl url = new PicasaTagsUrl(userName);

   String urlString = url.getAddTagUrl(album, photo, authKey);
if(dbg)
	Log.v(TAG, "tags url" + urlString);
   String content = PicasaXmlBuilder.addTagXmlString(tag);
   AsyncPutTask request = new AsyncPutTask(cachedWebPutRequestFetcher,
   		urlString,  content, "POST", false, "Loading albums...",  ctx,
       new RequestCallback() {
         @Override
         public void success(String data) {
       	  Log.v(TAG,"Success doAddTagRequest");
         }

         @Override
         public void error(String message) { 
         }
       });
   request.execute();
 }
 
开发者ID:YakindanEgitim,项目名称:Picasa-Tagger,代码行数:23,代码来源:TagManager.java

示例4: doDeleteTagRequest

import com.google.android.apps.picview.request.AsyncRequestTask.RequestCallback; //导入依赖的package包/类
private void doDeleteTagRequest(String tag, Album album, Photo photo) {
	PicasaTagsUrl url = new PicasaTagsUrl(userName);

    String urlString = url.getDeleteUrl(tags.get(tag),album, photo, authKey);
	if(dbg)
		Log.v(TAG, "tags url " + urlString);
    String content = PicasaXmlBuilder.addTagXmlString(tag);
    AsyncPutTask request = new AsyncPutTask(cachedWebPutRequestFetcher,
    		urlString,  content, "DELETE", false, "Loading albums...",  ctx,
        new RequestCallback() {
          @Override
          public void success(String data) {
        	  Log.v(TAG,"Success doDeleteTagRequest");
          } 

          @Override
          public void error(String message) {
          }
        });
    request.execute();
}
 
开发者ID:YakindanEgitim,项目名称:Picasa-Tagger,代码行数:22,代码来源:TagManager.java

示例5: doAllTagRequest

import com.google.android.apps.picview.request.AsyncRequestTask.RequestCallback; //导入依赖的package包/类
private void doAllTagRequest() {
// Use text field value.
PicasaTagsUrl url = new PicasaTagsUrl(userName);

    String urlString = url.getAuthUrl(authKey);
if(dbg)
	Log.v(TAG, "tags url" + urlString);
   AsyncRequestTask request = new AsyncRequestTask(cachedWebRequestFetcher,
   		urlString,   true,  null, ctx,
       new RequestCallback() {
         @Override
         public void success(String data) {
       	  tags = parseTagFromPicasaXml(data);
       	  startDeleteTags();
       	  Log.v(TAG,"Success doAllTagRequest");
         }
 
         @Override
         public void error(String message) {

       	  Log.v(TAG,"doAllTagRequest error");
         }
       });
   request.execute();
 }
 
开发者ID:YakindanEgitim,项目名称:Picasa-Tagger,代码行数:26,代码来源:TagManager.java

示例6: doPhotosRequest

import com.google.android.apps.picview.request.AsyncRequestTask.RequestCallback; //导入依赖的package包/类
private void doPhotosRequest(final Album album, String gdataUrl) {
  AsyncRequestTask request = new AsyncRequestTask(cachedWebRequestFetcher,
      gdataUrl, false, "Loading photos...", this,
      new RequestCallback() {

        @Override
        public void success(String data) {
          showPhotos(album, Photo.parseFromPicasaXml(data));
        }

        @Override
        public void error(String message) {
          Log.e(TAG, "Could not load photos: " + message);
          showError("Error while fetching photos");
        }
      });
  request.execute();
}
 
开发者ID:YakindanEgitim,项目名称:Picasa-Tagger,代码行数:19,代码来源:AlbumListActivity.java

示例7: doAlbumsRequest

import com.google.android.apps.picview.request.AsyncRequestTask.RequestCallback; //导入依赖的package包/类
/**
 * Loads the albums for the given user.
 * 
 * TODO: This is Picasa specific.
 */
private void doAlbumsRequest(String userName, String authKey) {
  // Use text field value.
  PicasaAlbumsUrl url = new PicasaAlbumsUrl(userName);

  String urlString;
  if(authKey != null)
  	urlString = url.getAuthUrl(authKey);
  else
  	urlString = url.getUrl();
  AsyncRequestTask request = new AsyncRequestTask(cachedWebRequestFetcher,
  		urlString, false, "Loading albums...", this,
      new RequestCallback() {
        @Override
        public void success(String data) {
          AlbumListActivity.this.albums = Album.parseFromPicasaXml(data);
          Log.d(TAG, "Albums loaded: " + AlbumListActivity.this.albums.size());
          showAlbums();
        }

        @Override
        public void error(String message) {
          Log.e(TAG, "Could not load albums: " + message);
          showError("Error while fetching albums");
        }
      });
  request.execute();
}
 
开发者ID:YakindanEgitim,项目名称:Picasa-Tagger,代码行数:33,代码来源:AlbumListActivity.java


注:本文中的com.google.android.apps.picview.request.AsyncRequestTask.RequestCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。