本文整理汇总了Java中cn.bmob.v3.listener.GetListener类的典型用法代码示例。如果您正苦于以下问题:Java GetListener类的具体用法?Java GetListener怎么用?Java GetListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GetListener类属于cn.bmob.v3.listener包,在下文中一共展示了GetListener类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadDataByNet
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
private void loadDataByNet() {
BmobQuery<Content> query = new BmobQuery<>();
query.getObject(DetailActivity.this, mContent.getObjectId(), new GetListener<Content>() {
@Override
public void onSuccess(Content content) {
setData(content);
//把数据缓存到本地
SaveCacheAsyncTask savecaheTask = new SaveCacheAsyncTask(DetailActivity.this, content, CacheHelper.CONTENT_CACHE_KEY + mContent.getObjectId());
savecaheTask.execute();
mLoadingLayout.setLoadingLayout(LoadingLayout.HIDE_LAYOUT);
mScrollViewEx.setVisibility(View.VISIBLE);
}
@Override
public void onFailure(int i, String s) {
if (mLoadingLayout.getState() == LoadingLayout.STATE_REFRESH) {
mLoadingLayout.setLoadingLayout(LoadingLayout.NETWORK_ERROR);
}
}
});
}
示例2: initWebView
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
/**
* 初始化网路数据:
*/
private void initWebView()
{
BmobQuery<o> query = new BmobQuery<o>();
query.getObject(lua_web.this, "957aaf7e08", new GetListener<o>() {
@Override
public void onSuccess(o object)
{
wv_web.loadUrl(object.getContent());
wv_web.setWebViewClient(new MyWebViewClient());
wv_web.setDownloadListener(new MyDownLoadListener());
}
@Override
public void onFailure(int code, String msg)
{
}
});}
示例3: syncUser
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
public void syncUser(final Context context, final String user_id,final Callback callback) {
BmobQuery<User> userQuery = new BmobQuery<User>();
userQuery.getObject(context, user_id, new GetListener<User>() {
@Override
public void onSuccess(User user) {
Logs.e("syncUser onSuccess");
PineApplication.mCurrentUser = user;
updateLocalUser(user);
if (null != callback)
callback.onSuccess();
}
@Override
public void onFailure(int i, String s) {
Logs.e("syncUser onFailure" + s);
}
});
}
示例4: setData
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
public void setData() {
User userInfo = BmobUser.getCurrentUser(MyCollectionActivity.this, User.class);
BmobQuery<User> query = new BmobQuery<User>();
final List<String> hobby = new ArrayList<>();
query.getObject(MyCollectionActivity.this, userInfo.getObjectId(), new GetListener<User>() {
@Override
public void onSuccess(User object) {
// TODO Auto-generated method stub
Message msg = new Message();
msg.what = UPDATE;
msg.obj = object.getHobby();
handler.sendMessage(msg);
}
@Override
public void onFailure(int i, String s) {
}
});
}
示例5: getLocalTimetableCourse
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
@Override
public void getLocalTimetableCourse(String timeCourseId, final LoadCourseCallback callback) {
BmobQuery<Course> singleCourseQuery = new BmobQuery<>();
singleCourseQuery.addWhereContains(
CoursePersistenceContract.CourseTimetableEntry.COLUMN_NAME_TIME_ID,timeCourseId);
singleCourseQuery.getObject(mContext, timeCourseId, new GetListener<Course>() {
@Override
public void onSuccess(Course course) {
callback.onCourseLoaded(course);
}
@Override
public void onFailure(int i, String s) {
callback.onDataError();
}
});
}
示例6: r
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
private void r()
{
BmobQuery<o> query = new BmobQuery<o>();
query.getObject(this, "b8e2da92f1", new GetListener<o>() {
@Override
public void onSuccess(o object)
{
String s=object.getContent();
String sr="fi";
if (s.equals(sr))
{
Toast.makeText(getApplicationContext(), "请更新到新版", Toast.LENGTH_SHORT).show();
finish();
}
else
{
}}
// .setCancelable(false).
@Override
public void onFailure(int code, String msg)
{
// finish();
}
});
}
示例7: xft
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
private void xft()
{
BmobQuery<i_a> query = new BmobQuery<i_a>();
query.getObject(WeiboListActivity.this, "03bf357e85", new GetListener<i_a>() {
@Override
public void onSuccess(i_a object)
{
String s = object.getContent();
String sr = nico.styTool.Constant.a_mi + "\n" + nico.styTool.Constant.a_miui;
if (s.equals(sr))
{
}
else
{
nico.styTool.ToastUtil.show(WeiboListActivity.this, "版本不一致,请更新", Toast.LENGTH_SHORT);
finish();
}
}
// .setCancelable(false).
@Override
public void onFailure(int code, String msg)
{
}
});
}
示例8: initView
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
private void initView()
{
toolbar = (android.support.v7.widget.Toolbar)
findViewById(R.id.toolbar);
// 初始化Toolbar控件
setSupportActionBar(toolbar);
// 用Toolbar取代ActionBar
//toolbar.setTitleTextColor(getResources().getColor(R.color.text_font_white));//标题颜色
// toolbar.setSubtitleTextColor(getResources().getColor(R.color.text_font_white));//副标题颜色
username = (RelativeLayout) findViewById(R.id.lxw_user_profile_username);
usernameText = (TextView) findViewById(R.id.lxw_id_user_profile_username_text);
email = (TextView) findViewById(R.id.lxw_id_user_profile_email);
Img = (RelativeLayout) findViewById(R.id.lxw_user_profile_img);
userImg = (ImageView) findViewById(R.id.lxw_id_user_profile_userimg);
sex = (RelativeLayout) findViewById(R.id.lxw_user_profile_sex);
personality = (RelativeLayout) findViewById(R.id.lxw_user_profile_personality);
personalityText = (TextView) findViewById(R.id.lxw_user_profile_personality_text);
a = (TextView) findViewById(R.id.lxwuserprofileTextView1);
btn = (Button) findViewById(R.id.lxw_user_profile_btn_save);
BmobQuery<MyUser> query = new BmobQuery<MyUser>();
query.getObject(this, myUser.getObjectId(), new GetListener<MyUser>() {
@Override
public void onSuccess(MyUser object)
{
TextView sexText = (TextView) findViewById(R.id.lxw_id_user_profile_sex_text);
Integer ios = object.getSex();
sexText.setText(Integer.toString(ios));
if (object.getAddress().equals("激活"))
{
CheckBox cb = (CheckBox) findViewById(R.id.lxwuserprofileCheckBox2);
cb.setChecked(true);//选中
}
else
{
}
String s="" + object.getEmailVerified();
String sr="true";
if (s.equals(sr))
{
CheckBox b = (CheckBox) findViewById(R.id.lxwuserprofileCheckBox1);
b.setChecked(true);//选中
}
else
{
//Toast.makeText(WeiboListActivity.this, "未激活帐号最多(68字)", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onFailure(int code, String msg)
{
// TODO Auto-generated method stub
}
});
}
示例9: setData
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
public void setData(PlaceDetailBean.PlaceResult data) {
if (data != null) {
dataName = data.getName();
Log.d("name", dataName);
if (!data.getTelephone().isEmpty()) {
dataPhone = data.getTelephone();
} else
dataPhone = "无";
dataUrl = data.getUrl();
dataDescription = data.getDescription();
dataPrice = data.getTicket_info().getPrice();
dataOpernTime = data.getTicket_info().getOpen_time();
if (!(data.getTicket_info().getAttention() == null)) {
dataAtName = data.getTicket_info().getAttention().get(0).getName();
} else dataAtName = "没有详细信息";
if (!(data.getTicket_info().getAttention() == null)) {
dataAtDescription = data.getTicket_info().getAttention().get(0).getDescription();
} else dataAtDescription = "没有详细信息";
}
BmobQuery<User> query = new BmobQuery<User>();
query.getObject(PlaceDetailActivity.this, userInfo.getObjectId(), new GetListener<User>() {
@Override
public void onSuccess(User object) {
if (object.getHobby() != null) {
hobby.addAll(object.getHobby());
for (int i = 0; i < hobby.size(); i++) {
if (hobby.get(i).equals(dataName)) {
Flag = 1;
}
}
Log.d("Flag", String.valueOf(Flag));
if (Flag == 0) {
icCollect.setImageResource(R.drawable.ic_weishoucang);
}
if (Flag == 1)
icCollect.setImageResource(R.drawable.ic_shoucang);
initView();
}
}
@Override
public void onFailure(int code, String arg0) {
}
});
}
示例10: findNoteByObjId
import cn.bmob.v3.listener.GetListener; //导入依赖的package包/类
/**
* 根据ObjectId查找一个NOTE
* @param context
* @param id
* @return
*/
public static void findNoteByObjId(final Context context, final String id,GetListener<CloudNote> listener){
noteQuery = new BmobQuery<>();
noteQuery.getObject(context, id, listener);
}