mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
code simplification
This commit is contained in:
parent
ed6c6387ba
commit
4c0338946e
3 changed files with 7 additions and 20 deletions
|
@ -76,6 +76,11 @@ public abstract class Util implements UserRegistrationConstants {
|
|||
);
|
||||
}
|
||||
|
||||
static void addAuthorizationData(Intent intent, INetworkLink link) {
|
||||
intent.putExtra(CATALOG_URL, link.getUrl(UrlInfo.Type.Catalog));
|
||||
intent.putExtra(SIGNUP_URL, link.getUrl(UrlInfo.Type.SignUp));
|
||||
}
|
||||
|
||||
public static void runRegistrationDialog(Activity activity, INetworkLink link) {
|
||||
try {
|
||||
final NetworkAuthenticationManager mgr = link.authenticationManager();
|
||||
|
@ -83,11 +88,7 @@ public abstract class Util implements UserRegistrationConstants {
|
|||
AUTHORIZATION_ACTION,
|
||||
Uri.parse(link.getUrl(UrlInfo.Type.Catalog) + "/register")
|
||||
);
|
||||
if (mgr != null) {
|
||||
for (Map.Entry<String,String> entry : mgr.getAccountData().entrySet()) {
|
||||
intent.putExtra(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
addAuthorizationData(intent, link);
|
||||
if (PackageUtil.canBeStarted(activity, intent, true)) {
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue