mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
new mechanism for notification about registration
This commit is contained in:
parent
1b96f763d2
commit
36c46fab34
15 changed files with 99 additions and 74 deletions
|
@ -19,6 +19,8 @@
|
|||
|
||||
package org.geometerplus.android.fbreader.network;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
|
@ -76,13 +78,18 @@ public abstract class Util implements UserRegistrationConstants {
|
|||
|
||||
public static void runRegistrationDialog(Activity activity, INetworkLink link) {
|
||||
try {
|
||||
final NetworkAuthenticationManager mgr = link.authenticationManager();
|
||||
final Intent intent = new Intent(
|
||||
AUTHORIZATION_ACTION,
|
||||
Uri.parse(link.getUrl(UrlInfo.Type.Catalog) + "/register")
|
||||
);
|
||||
intent.putExtra(UserRegistrationConstants.SIGNUP_URL, link.getUrl(UrlInfo.Type.SignUp));
|
||||
if (mgr != null) {
|
||||
for (Map.Entry<String,String> entry : mgr.getAccountData().entrySet()) {
|
||||
intent.putExtra(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
if (PackageUtil.canBeStarted(activity, intent, true)) {
|
||||
activity.startActivityForResult(intent, NetworkLibraryActivity.SIGNUP_CODE);
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
} catch (ActivityNotFoundException e) {
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue