當前位置: 首頁>>代碼示例>>Java>>正文


Java AsyncTaskLoader類代碼示例

本文整理匯總了Java中android.content.AsyncTaskLoader的典型用法代碼示例。如果您正苦於以下問題:Java AsyncTaskLoader類的具體用法?Java AsyncTaskLoader怎麽用?Java AsyncTaskLoader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AsyncTaskLoader類屬於android.content包,在下文中一共展示了AsyncTaskLoader類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<ProfileFieldContainer> onCreateLoader(int id, Bundle args) {
    return new AsyncTaskLoader<ProfileFieldContainer>(getActivity()) {
        @Override
        public ProfileFieldContainer loadInBackground() {
            ProfileFieldContainer result;
            if (SELF_IDENTIFIER.equals(mProfileIdentifier)) {
                result = mLocalProfile.getValueBulk(FIELDS);
                mLocalProfile.disconnect();
            } else {
                SPFSearch search = mSpf.getComponent(SPF.SEARCH);
                SPFPerson person = search.lookup(mProfileIdentifier);
                if (person == null) {
                    Log.w(TAG, "Person " + mProfileIdentifier + " is not available");
                    return null;
                }

                result = person.getProfile(mSpf).getProfileBulk(FIELDS);
            }

            return result;
        }
    };
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:25,代碼來源:ProfileFragment.java

示例2: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<List<PersonInfo>> onCreateLoader(int id, Bundle args) {
	switch (id) {
	case LOAD_CONTACTS_LOADER:
		return new AsyncTaskLoader<List<PersonInfo>>(getActivity()) {

			@Override
			public List<PersonInfo> loadInBackground() {
				return SPF.get().getSecurityMonitor().getPersonRegistry().getAvailableContacts();
			}
		};
	case LOAD_REQUEST_LOADER:
		return new AsyncTaskLoader<List<PersonInfo>>(getActivity()) {

			@Override
			public List<PersonInfo> loadInBackground() {
				return SPF.get().getSecurityMonitor().getPersonRegistry().getPendingRequests();
			}
		};
	default:
		return null;
	}
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:24,代碼來源:PeopleFragment.java

示例3: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<Collection<ActivityVerb>> onCreateLoader(int id, Bundle args) {
	switch (id) {
	case LOAD_LIST_LOADER_ID:
		return new AsyncTaskLoader<Collection<ActivityVerb>>(getActivity()) {

			@Override
			public Collection<ActivityVerb> loadInBackground() {
				return SPF.get().getServiceRegistry().getSupportedVerbs();
			}

		};

	default:
		return null;
	}
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:18,代碼來源:ActivityFragment.java

示例4: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<List<AppAuth>> onCreateLoader(int id, Bundle args) {
	switch (id) {
	case APP_LOADER:
		return new AsyncTaskLoader<List<AppAuth>>(getActivity()) {

			@Override
			public List<AppAuth> loadInBackground() {
				return SPF.get().getSecurityMonitor().getAvailableApplications();
			}
		};

	default:
		return null;
	}
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:17,代碼來源:AppManagerFragment.java

示例5: type

import android.content.AsyncTaskLoader; //導入依賴的package包/類
public static SubjectFactory<AsyncTaskLoaderSubject, AsyncTaskLoader> type() {
  return new SubjectFactory<AsyncTaskLoaderSubject, AsyncTaskLoader>() {
    @Override
    public AsyncTaskLoaderSubject getSubject(FailureStrategy fs, AsyncTaskLoader that) {
      return new AsyncTaskLoaderSubject(fs, that);
    }
  };
}
 
開發者ID:pkware,項目名稱:truth-android,代碼行數:9,代碼來源:AsyncTaskLoaderSubject.java

示例6: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<List<Conversation>> onCreateLoader(int id, Bundle args) {
    switch(id){
        case CONVERSATION_LOADER:
            return new AsyncTaskLoader<List<Conversation>>(getActivity()) {
                @Override
                public List<Conversation> loadInBackground() {
                    return ChatDemoApp.get().getChatStorage().getAllConversations();
                }
            };
        default:
            return null;
    }
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:15,代碼來源:ConversationListFragment.java

示例7: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<List<Message>> onCreateLoader(int id, Bundle args) {
    switch (id){
        case MESSAGE_LOADER_ID:
            return new AsyncTaskLoader<List<Message>>(this) {
                @Override
                public List<Message> loadInBackground() {
                    mStorage.markAsRead(mConversation);
                    return mStorage.getAllMessages(mConversation);
                }
            };
        default:
            return null;
    }
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:16,代碼來源:ConversationActivity.java

示例8: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<List<Coupon>> onCreateLoader(int id, Bundle args) {
	return new AsyncTaskLoader<List<Coupon>>(getActivity()) {

		@Override
		public List<Coupon> loadInBackground() {
			return ProviderApplication.get().getCouponDatabase().getAllCoupons();
		}
	};
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:11,代碼來源:CouponManagerFragment.java

示例9: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<Coupon> onCreateLoader(int id, Bundle args) {
	return new AsyncTaskLoader<Coupon>(CouponDetailActivity.this) {

		@Override
		public Coupon loadInBackground() {
			return ProviderApplication.get().getCouponDatabase().getCouponById(mCouponId);
		}
		
	};
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:12,代碼來源:CouponDetailActivity.java

示例10: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<List<Coupon>> onCreateLoader(int id, Bundle args) {
	return new AsyncTaskLoader<List<Coupon>>(getActivity()) {

		@Override
		public List<Coupon> loadInBackground() {
			return ClientApplication.get().getCouponDatabase().getAllCoupons();
		}
	};
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:11,代碼來源:CouponManagerFragment.java

示例11: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<Coupon> onCreateLoader(int id, Bundle args) {
	return new AsyncTaskLoader<Coupon>(CouponDetailActivity.this) {

		@Override
		public Coupon loadInBackground() {
			return ClientApplication.get().getCouponDatabase().getCouponById(mCouponId);
		}
		
	};
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:12,代碼來源:CouponDetailActivity.java

示例12: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<List<NotificationMessage>> onCreateLoader(int id, final Bundle args) {
	switch (id) {
	case MESSAGE_LOADER_ID:
		return new AsyncTaskLoader<List<NotificationMessage>>(getActivity()) {

			@Override
			public List<NotificationMessage> loadInBackground() {
				return SPF.get().getNotificationManager().getAvailableNotifications();
			}
		};
	case MESSAGE_DELETER_ID:
		return new AsyncTaskLoader<List<NotificationMessage>>(getActivity()) {

			@Override
			public List<NotificationMessage> loadInBackground() {
				if(args == null){
					SPF.get().getNotificationManager().deleteAllNotifications();
				} else {
					long msgId = args.getLong(EXTRA_MESSAGE_ID);
					SPF.get().getNotificationManager().deleteNotification(msgId);
				}
				return SPF.get().getNotificationManager().getAvailableNotifications();
			}
		};

	default:
		return null;
	}
}
 
開發者ID:deib-polimi,項目名稱:SPF,代碼行數:31,代碼來源:NotificationFragment.java

示例13: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override
public Loader<ArrayList<LogEntry>> onCreateLoader(int arg0, Bundle arg1) {
	
       AsyncTaskLoader<ArrayList<LogEntry>> loader = new AsyncTaskLoader<ArrayList<LogEntry>>(getActivity()) {
       	 
       	@Override
	    public ArrayList<LogEntry> loadInBackground() {
	    	return JSONLogReader.getLogsFromFile(logger.getLogFile().getPath());
	    }
       };

       loader.forceLoad();
	
	return loader;
}
 
開發者ID:williamwebb,項目名稱:alogger,代碼行數:16,代碼來源:LogFragment.java

示例14: onCreateLoader

import android.content.AsyncTaskLoader; //導入依賴的package包/類
@Override public Loader<Bitmap> onCreateLoader(int id, Bundle args) {
    return new AsyncTaskLoader<Bitmap>(this) {

        @Override protected void onStartLoading() {
            forceLoad();
        }

        @Override public Bitmap loadInBackground() {
            return readBitmapFromDisk(mImageName);
        }
    };
}
 
開發者ID:emmaguy,項目名稱:wear-notify-for-reddit,代碼行數:13,代碼來源:ViewImageActivity.java

示例15: AsyncTaskLoaderSubject

import android.content.AsyncTaskLoader; //導入依賴的package包/類
protected AsyncTaskLoaderSubject(FailureStrategy failureStrategy, AsyncTaskLoader subject) {
  super(failureStrategy, subject);
}
 
開發者ID:pkware,項目名稱:truth-android,代碼行數:4,代碼來源:AsyncTaskLoaderSubject.java


注:本文中的android.content.AsyncTaskLoader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。