# How to wait for an activity to be "ready" on android

**URL:** <https://discuss.appium.io/t/how-to-wait-for-an-activity-to-be-ready-on-android/3557>\
**Category:** Support\
**Created:** [March 26, 2015, 3:01pm UTC](https://discuss.appium.io/t/how-to-wait-for-an-activity-to-be-ready-on-android/3557 "2015-03-26T15:01:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![augment](https://discuss.appium.io/user_avatar/discuss.appium.io/augment/32/5228_2.png) [@augment](https://discuss.appium.io/u/augment)\
**Post date:** [March 26, 2015, 3:01pm UTC](https://discuss.appium.io/t/how-to-wait-for-an-activity-to-be-ready-on-android/3557/1 "2015-03-26T15:01:37Z")

</div>

I click on an element,  
then I want to wait for the activity to be “ready” (ie has finish to launch)  
to click to a button on this new activity

```auto
find_elements(:xpath, xpath_first_3dmodels).first.click
exists { name "ar_view" }
back

```

But i do not understand why the exist is not blocking, and the back is immediately triggered,  
what am i doing wrong ?

---

<div class="post-metadata">

**Author:** ![shermaneric](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@shermaneric](https://discuss.appium.io/u/shermaneric)\
**Post date:** [October 1, 2015, 5:48pm UTC](https://discuss.appium.io/t/how-to-wait-for-an-activity-to-be-ready-on-android/3557/2 "2015-10-01T17:48:40Z")

</div>

Take a look at this thread. I think you want to do a wait until current\_activity produces the activity you desire before continuing.

> [@start\_activity not working](https://discuss.appium.io/t/start-activity-not-working/1788/7):
>
> Could you help me? I’m really new into Ruby and Appium and struggled some time with “activity”. methods, but without success. How to use start\_activity or current\_activity it in Ruby? I have code (based on some tutorials): config.before(:all) do @driver = Appium::Driver.new(caps) @driver.start\_driver end but when I write: @driver.current\_activity error is - method not found. When I navigate to this class (Appium::Driver) in IntelliJ - it tells me about files: driver.rb or android/dy…
