start main activity as new task to reset activity history
This commit is contained in:
parent
b9a9e5a0b3
commit
521d8ef388
4 changed files with 23 additions and 8 deletions
|
|
@ -106,7 +106,10 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
|
||||||
if (result.getAccessToken() == null) return;
|
if (result.getAccessToken() == null) return;
|
||||||
serverCredentials.GetServer(result.getServerId()).setAccessToken(result.getAccessToken());
|
serverCredentials.GetServer(result.getServerId()).setAccessToken(result.getAccessToken());
|
||||||
credentialProvider.SaveCredentials(serverCredentials);
|
credentialProvider.SaveCredentials(serverCredentials);
|
||||||
context.startActivity(new Intent(context, MainActivity.class));
|
|
||||||
|
Intent intent = new Intent(context, MainActivity.class);
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,8 +200,10 @@ public class MainActivity extends AbsSlidingMusicPanelActivity {
|
||||||
} else {
|
} else {
|
||||||
drawerLayout.openDrawer(navigationView);
|
drawerLayout.openDrawer(navigationView);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -211,6 +213,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity {
|
||||||
drawerLayout.closeDrawers();
|
drawerLayout.closeDrawers();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.handleBackPress() || (currentFragment != null && currentFragment.handleBackPress());
|
return super.handleBackPress() || (currentFragment != null && currentFragment.handleBackPress());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import org.jellyfin.apiclient.interaction.VolleyHttpClient;
|
||||||
import org.jellyfin.apiclient.interaction.connectionmanager.ConnectionManager;
|
import org.jellyfin.apiclient.interaction.connectionmanager.ConnectionManager;
|
||||||
import org.jellyfin.apiclient.interaction.http.IAsyncHttpClient;
|
import org.jellyfin.apiclient.interaction.http.IAsyncHttpClient;
|
||||||
import org.jellyfin.apiclient.logging.AndroidLogger;
|
import org.jellyfin.apiclient.logging.AndroidLogger;
|
||||||
|
import org.jellyfin.apiclient.model.apiclient.ConnectionState;
|
||||||
import org.jellyfin.apiclient.model.logging.ILogger;
|
import org.jellyfin.apiclient.model.logging.ILogger;
|
||||||
import org.jellyfin.apiclient.model.serialization.GsonJsonSerializer;
|
import org.jellyfin.apiclient.model.serialization.GsonJsonSerializer;
|
||||||
import org.jellyfin.apiclient.model.serialization.IJsonSerializer;
|
import org.jellyfin.apiclient.model.serialization.IJsonSerializer;
|
||||||
|
|
@ -49,9 +50,17 @@ public class SplashActivity extends AbsBaseActivity {
|
||||||
connectionManager.Connect(credentialProvider.GetCredentials().getServers().get(0), new Response<ConnectionResult>() {
|
connectionManager.Connect(credentialProvider.GetCredentials().getServers().get(0), new Response<ConnectionResult>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(ConnectionResult result) {
|
public void onResponse(ConnectionResult result) {
|
||||||
//if (result.getState() != ConnectionState.SignedIn) return;
|
if (result.getState() != ConnectionState.SignedIn) {
|
||||||
App.setApiClient(result.getApiClient());
|
Intent intent = new Intent(context, LoginActivity.class);
|
||||||
context.startActivity(new Intent(context, MainActivity.class));
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
|
} else {
|
||||||
|
App.setApiClient(result.getApiClient());
|
||||||
|
|
||||||
|
Intent intent = new Intent(context, MainActivity.class);
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
include ':app'
|
include ':app'
|
||||||
|
|
||||||
include ':apiclient'
|
// include ':apiclient'
|
||||||
project(':apiclient').projectDir = new File(settingsDir, '../jellyfin-apiclient-java/android')
|
// project(':apiclient').projectDir = new File(settingsDir, '../jellyfin-apiclient-java/android')
|
||||||
|
|
||||||
include ':library'
|
// include ':library'
|
||||||
project(':library').projectDir = new File(settingsDir, '../jellyfin-apiclient-java/library')
|
// project(':library').projectDir = new File(settingsDir, '../jellyfin-apiclient-java/library')
|
||||||
Loading…
Add table
Add a link
Reference in a new issue