use of com.umeng.update.UmengUpdateListener in project SunDay by iQuick.
the class SettingActivity method clickUpdate.
/**
* 检查更新
*/
@Click(R.id.setting_check_update)
void clickUpdate() {
UmengUpdateAgent.setDefault();
UmengUpdateAgent.forceUpdate(SettingActivity.this);
UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
@Override
public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
switch(updateStatus) {
case // has no update
UpdateStatus.No:
ToastUtil.showShort(R.string.no_update);
break;
}
}
});
}
use of com.umeng.update.UmengUpdateListener in project SunDay by iQuick.
the class SplashActivity method updateApk.
/**
* 友盟更新
*/
private void updateApk() {
UmengUpdateAgent.setDefault();
UmengUpdateAgent.update(SplashActivity.this);
UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
@Override
public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
switch(updateStatus) {
case // has no update
UpdateStatus.No:
isFrast();
break;
}
}
});
UmengUpdateAgent.setDialogListener(new UmengDialogButtonListener() {
@Override
public void onClick(int i) {
// 进入下界面
isFrast();
// 打印日志
switch(i) {
case UpdateStatus.Update:
// 用户选择现在更新;
LogUtil.i(TAG, "Update");
break;
case UpdateStatus.Ignore:
// 用户选择忽略该版;
LogUtil.i(TAG, "Ignore");
break;
case UpdateStatus.NotNow:
// 用户选择以后再说,点击回退键,关闭对话框。
LogUtil.i(TAG, "NotNow");
break;
}
}
});
}
Aggregations