Will the loop end at run time or will the VM return to end it?
The cycle ends, otherwise it does not completely โkillโ.
A simple test:
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new Thread(new Runnable() { @Override public void run() { try { while (true) { Log.i("LOOP", "Running"); Thread.sleep(1000); } } catch (InterruptedException e) {} } }).start(); } }
Deploy the app from the latest apps.
source share