本文整理汇总了Java中com.orhanobut.hawk.Hawk.contains方法的典型用法代码示例。如果您正苦于以下问题:Java Hawk.contains方法的具体用法?Java Hawk.contains怎么用?Java Hawk.contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.orhanobut.hawk.Hawk
的用法示例。
在下文中一共展示了Hawk.contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prePopulateUserCoins
import com.orhanobut.hawk.Hawk; //导入方法依赖的package包/类
public void prePopulateUserCoins() {
if (!Hawk.contains(BTC)) {
addUserCoin(BTC, Bitcoin);
}
if (!Hawk.contains(ETH)) {
addUserCoin(ETH, Ethereum);
}
if (!Hawk.contains(LTC)) {
addUserCoin(LTC, Litecoin);
}
}
示例2: getCoinName
import com.orhanobut.hawk.Hawk; //导入方法依赖的package包/类
public String getCoinName(String symbol) {
String coinName = null;
if (Hawk.contains(symbol)) {
coinName = Hawk.get(symbol);
}
return coinName;
}
示例3: startQueryGetRepos
import com.orhanobut.hawk.Hawk; //导入方法依赖的package包/类
private void startQueryGetRepos(final boolean pbPullToRefresh) {
final RepoListMvp.View loView = getView();
if (isViewAttached() && loView != null) {
loView.showLoading(pbPullToRefresh);
}
// "standard" preferences
if (TextUtils.isEmpty(preferences.getUsername())) {
preferences.setUsername("RoRoche");
}
// vs. Hawk
if (!Hawk.contains("key_username")) {
Hawk.put("key_username", "RoRoche");
}
//final QueryGetRepos loQuery = new QueryGetRepos(preferences.getUsername(), pbPullToRefresh);
final QueryGetRepos loQuery = new QueryGetRepos(Hawk.get("key_username"), pbPullToRefresh);
// If query requires network, and if network is unreachable, and if the query must not persist
if (loQuery.requiresNetwork() &&
!merlinsBeard.isConnected() &&
!loQuery.isPersistent()) {
// then, we post an event to notify the job could not be done because of network connectivity
loQuery.inject();
loQuery.postEventQueryFinishedNoNetwork();
} else {
// otherwise, we can add the job
jobManager.addJobInBackground(loQuery);
}
}