Commit f9608909 by Kazuyuki Hida

マスターデータ読み込みのエラー時にダイアログを出すようにした。

parent f6dd3d4d
apply plugin: 'java'
sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'
......
......@@ -835,7 +835,8 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpTaskWorker<HttpParameterObject> httpTaskThread = null;
try {
long t = HttpRequestSender.DefaultConnectionTimeout * 2;
//long t = HttpRequestSender.DefaultConnectionTimeout * 2;
long t = HttpRequestSender.DefaultConnectionTimeout / 10;
for (int i = 0; i < 3; i++, t *= 2) {
httpTaskThread = new HttpTaskWorker<HttpParameterObject>(methodName, apiUrl, param);
httpTaskThread.start();
......
......@@ -86,10 +86,6 @@ import jp.agentec.adf.util.DateTimeUtil;
private ContentRefresher() {
}
public void setContentDownloadListener(ContentDownloadListener contentDownloadListener) {
this.contentDownloadListener = contentDownloadListener;
}
/**
* コンテンツ情報をACMSから更新します。
* @throws ABVException キャッシュにユーザ情報がありません。再度ログインする必要があります。
......
......@@ -9,6 +9,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.FetchDateParameters;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.adf.util.FileUtil;
......@@ -25,7 +26,7 @@ public class MasterDataLogic extends AbstractLogic {
* @throws Exception その他、例外です。
* @since 1.0.0
*/
public String initializeMasterData(String lastFetchDate) {
public String initializeMasterData(String lastFetchDate) throws AcmsException, NetworkDisconnectedException, IOException {
String fetchDate = null;
try {
FetchDateParameters param = new FetchDateParameters(cache.getMemberInfo().sid, lastFetchDate);
......@@ -47,6 +48,7 @@ public class MasterDataLogic extends AbstractLogic {
fetchDate = masterDataJson.fetchDate;
} catch (Exception e) {
Logger.e(TAG, "masterDataSend error : ", e);
throw e;
}
// masterData の fetchDateを渡す。
return fetchDate;
......
......@@ -423,10 +423,23 @@ public class OperationListActivity extends OperationActivity {
@Override
public void onRefreshedContent(final boolean result, long contentId, Exception e) {
super.onRefreshedContent(result, contentId, e);
final Exception ex = e;
runOnUiThread(new Runnable() {
@Override
public void run() {
if (ex != null) {
// ヘッダーの新着更新処理を完了にさせる
stopUpdateAnimation();
final ABookAlertDialog messageDialog = AlertDialogUtil.createAlertDialog(OperationListActivity.this, R.string.app_name);
messageDialog.setMessage(getString(R.string.failed_get_master_data));
messageDialog.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
messageDialog.dismiss();
}
});
messageDialog.show();
}
if (!contentRefresher.isRefreshing()) {
// 新着処理が終わったら以下の処理が実行
stopUpdateAnimation();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment