Testing with Android Monkey.. stays on Preference screen?
<p>I have developed an app and have been using Monkey to test it.</p>

<p>My application has a main screen and a menu option which opens a preference screen. One thing I have realised though is that once monkey opens my preference screen, it tends to stay within the preference activity for a very long time. The only time it ever exits it is when it restarts my whole activity, and once it enters the preference activity it stays there again, vigorously testing my preference activity without exitting it.</p>

<p>This results in my preference activity getting a complete workout from monkey, but my main activity not receiving much attention from it. I know that the behaviour of monkey is completely random, but could it be that I am doing something wrong with my preference activity? Repeated testing from monkey has shown this behaviour to be consistent.</p>

<p>Below is the code for my preference activity :</p>

<pre><code>    public class MyPreferences extends PreferenceActivity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            addPreferencesFromResource(R.xml.my_preference);
        }
   }
</code></pre>

<p>And my manifest declaration:</p>

<pre><code>    &lt;activity android:name="com.myapp.android.testapp.MyPreferences" 
    android:label="@string/preference_activity_title" 
    android:configChanges="orientation|keyboard|keyboardHidden" 
    android:screenOrientation="portrait"/&gt;
</code></pre>

<p>Oh and I run monkey with the following code:</p>

<pre><code>    adb shell monkey -p com.myapp.android.testapp -v 100000
</code></pre>
