Android device does restart where I use for(;;)

Class library usage, coding and language questions.
stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Android device does restart where I use for(;;)

Post by stapes » Mon Oct 26, 2015 4:32 pm

I have put this into code in a few places. I am basically waiting for the Home Page to load following a log in.

Code: Select all

for(;;)
        	{
        		if(repo.UkCoDocumotiveMobileDocumobileAgile.LogoutInfo.Exists (1000))
	        	{
	        		break ;
	        	}
        	}
This page sometimes works, but often hangs for a while, then restarts the device. When the device starts up again, the application is in the expected state, i.e. the Logout control mentioned here now exists.

Is this something I am causing with Ranorex - especially with this constrict, i.e. for(;;)?

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Re: Android device does restart where I use for(;;)

Post by stapes » Wed Oct 28, 2015 11:03 am

I got rid if all these

Code: Select all

for(;;)
, replacing them with

Code: Select all

while(true)
and the problem has gone away, and the iPad stopped switching off & on at these points.

Maybe iOS does not like what looks like an infinite loop?