Browse Source

Don't do a full refresh on screen orientations. Fixed #9.

pull/82/head v2.0
Eric Kok 11 years ago
parent
commit
de6cf7573c
  1. 26
      core/src/org/transdroid/core/gui/TorrentsActivity.java

26
core/src/org/transdroid/core/gui/TorrentsActivity.java

@ -208,7 +208,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
// Log messages from the server daemons using our singleton logger // Log messages from the server daemons using our singleton logger
DLog.setLogger(Log_.getInstance_(this)); DLog.setLogger(Log_.getInstance_(this));
// Connect to the last used server or a server that was explicitly supplied in the starting intent // Load the last used server or a server that was explicitly supplied in the starting intent
ServerSetting lastUsed = applicationSettings.getLastUsedServer(); ServerSetting lastUsed = applicationSettings.getLastUsedServer();
if (lastUsed == null) { if (lastUsed == null) {
// No server settings yet; // No server settings yet;
@ -232,15 +232,25 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi
// Set this as selection in the action bar spinner; we can use the server setting key since we have stable ids // Set this as selection in the action bar spinner; we can use the server setting key since we have stable ids
// Note: skipNextOnNavigationItemSelectedCalls is used to prevent this event from triggering filterSelected // Note: skipNextOnNavigationItemSelectedCalls is used to prevent this event from triggering filterSelected
getSupportActionBar().setSelectedNavigationItem(lastUsed.getOrder() + 1); getSupportActionBar().setSelectedNavigationItem(lastUsed.getOrder() + 1);
filterSelected(lastUsed, true);
// Handle any start up intents // Connect to the last used server or a server that was explicitly supplied in the starting intent
if (startTorrent != null) { if (firstStart) {
openDetails(startTorrent); // Force first torrents refresh
startTorrent = null; filterSelected(lastUsed, true);
} else if (firstStart && getIntent() != null) { // Handle any start up intents
handleStartIntent(); if (firstStart && startTorrent != null) {
openDetails(startTorrent);
startTorrent = null;
} else if (firstStart && getIntent() != null) {
handleStartIntent();
}
} else {
// Resume after instead of fully loading the torrents list; create connection and set action bar title
currentConnection = lastUsed.createServerAdapter(connectivityHelper.getConnectedNetworkName());
navigationSpinnerAdapter.updateCurrentServer(currentConnection);
navigationSpinnerAdapter.updateCurrentFilter(currentFilter);
} }
firstStart = false;
// Start the alarms for the background services, if needed // Start the alarms for the background services, if needed
BootReceiver.startBackgroundServices(getApplicationContext(), false); BootReceiver.startBackgroundServices(getApplicationContext(), false);

Loading…
Cancel
Save