Skip to content
This repository has been archived by the owner on Apr 16, 2018. It is now read-only.

Commit

Permalink
Fix dashboard handring.
Browse files Browse the repository at this point in the history
  • Loading branch information
rummelonp committed Jan 18, 2011
1 parent 6a5e2e7 commit c8fc932
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/jp/mitukiii/tumblife/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ protected void onCreate(Bundle savedInstanceState)
dashboard.addQueues();
dashboard.start();
} catch (Exception e) {
TLLog.i("Main / onCreate", e);
dashboard = new TLDashboard(delegate, context, handler);
}
} else {
Expand Down Expand Up @@ -173,7 +172,6 @@ protected void onResume()
}

if (dashboard.isLogged()) {
TLLog.i("Main / onResume : Logged.");
TLPost post = dashboard.postCurrent();
if (post == null) {
setEnabledButtons(false);
Expand All @@ -182,12 +180,18 @@ protected void onResume()
setEnabledButtons(true);
movePost(post);
}
if (dashboard.isRunned()) {
TLLog.i("Main / onResume : Logged and running.");
} else {
TLLog.i("Main / onResume : Logged and starting.");
dashboard.start();
}
} else {
TLLog.i("Main / onResume : start.");
setEnabledButtons(false);
setting.loadAccount(context);
webView.loadUrl(postFactory.getDefaultHtmlUrl());
setTitle(dashboard.getTitle());
setting.loadAccount(context);
start();
};
}
Expand All @@ -213,9 +217,9 @@ protected void onDestroy()

if (isFinished) {
TLLog.i("Main / onDestroy : Finished.");
postFactory.destroy();
dashboard.destroy();
dashboard.deleteFiles();
postFactory.destroy();
System.exit(RESULT_OK);
} else {
TLLog.i("Main / onDestroy : Maintain dashboard.");
Expand Down Expand Up @@ -600,12 +604,10 @@ protected void reload()
setEnabledButtons(false);
setting.loadAccount(context);
setting.loadSetting(context);
postFactory.stop();
postFactory.destroy();
postFactory = TLPostFactory.getSharedInstance(context);
dashboard.stop();
dashboard.destroy();
dashboard = new TLDashboard(this, context, handler);
postFactory = TLPostFactory.getSharedInstance(context);
dashboard = new TLDashboard(delegate, context, handler);
webView.loadUrl(postFactory.getDefaultHtmlUrl());
setTitle(dashboard.getTitle());
start();
Expand Down Expand Up @@ -892,4 +894,4 @@ protected void privatePost()
showToast(R.string.write);
dashboard.writeRegular(text, null, parameters);
}
}
}

0 comments on commit c8fc932

Please sign in to comment.