Question: please give me solution how to scroll two horizont recyclerviews side by side how to scroll two horizontal scrollviews side by side if i scroll any recycleview both will work like single recyclervie

```
    <HorizontalScrollView
                android:id="@+id/nested"
                android:background="@color/Ashh"
  android:fillViewport="true"
            android:measureAllChildren="true"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">
                <androidx.recyclerview.widget.RecyclerView
                    android:layout_width="wrap_content"
                    android:id="@+id/serverlist"
                    android:background="@color/Ashh"
                    android:nestedScrollingEnabled="false"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    android:orientation="horizontal"
                    android:layout_height="wrap_content"/>
                    <androidx.recyclerview.widget.RecyclerView
                    android:layout_width="wrap_content"
                    android:id="@+id/locallist"
                    android:background="@color/Ashh"
                        android:nestedScrollingEnabled="false"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    android:orientation="horizontal"
                    android:layout_height="wrap_content"/>
                </LinearLayout>
            </HorizontalScrollView>

```

Answer: 
If the `signUp` method is blocking (i.e. it returns once the signup is finished), your code should work as expected. So I suspect it is asynchronous.

In that case, on top of using a boolean, you could also use a `CountDownLatch` to wait until the async method completes:

```
AtomicBoolean success = new AtomicBoolean(false);
CountDownLatch done = new CountDownLatch(1);
Amplify.Auth.signUp(
        email,
        password,
        AuthSignUpOptions.builder().userAttribute(AuthUserAttributeKey.email(), email).build(),
        result -> { success.set(true); done.countDown(); },
        error -> { Log.e("AuthQuickStart", "Sign up failed", error); done.countDown(); }
);
done.await(); //you may want to add a timeout here
Log.d("success", String.valueOf(success.get()));

```
@assylias's and @jakub-bialy's answers are totally valid. However, neither considers the `error` callback. Additionally, using a `CountDownLatch` directly is a little low-level.

Amplify provides an [`rxbindings`](https://github.com/aws-amplify/amplify-android/tree/main/rxbindings#amplify-android-rxbindings) module, which can help simplify asynchronous programming.

In your case, you could use [the Rx version of the `signUp(...)` method](https://github.com/aws-amplify/amplify-android/blob/main/rxbindings/src/main/java/com/amplifyframework/rx/RxAuthCategoryBehavior.java#L44-L58), like so:

```java
// Change your initialization to:
RxAmplify.addPlugin(new AWSCognitoAuthPlugin())
RxAmplify.configure(getApplicationContext())

// Sign-up, in a blocking way:
AuthSignUpOptions options = AuthSignUpOptions.builder()
    .userAttribute(AuthUserAttributeKey.email(), email)
    .build();
AuthSignUpResult result =
    RxAmplify.Auth.signUp(email, password, options)
        .timeout(10, TimeUnit.SECONDS)
        .blockingGet();

```

The `signUp(...)` call in this case will throw the `error` in a blocking way, in the thread that makes the call. In the other answers, this `error` is ignored.