Hello,
I'm newer in ANDROID and not understand why the TOAST not appear in this case.
If i comment the loop "Boucle()" that's works, else not
Thanks and good day
I'm newer in ANDROID and not understand why the TOAST not appear in this case.
If i comment the loop "Boucle()" that's works, else not
Code:
package com.example.toast;
import android.os.Bundle;
import android.app.Activity;
import android.view.Gravity;
import android.widget.Toast;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toast toast= Toast.makeText(MainActivity.this, "I'm a TOAST and i not appear.", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER_VERTICAL|Gravity.CENTER_HORIZONTAL, 0, 0);
toast.show();
//Boucle();
}
public void Boucle()
{
Integer a = 0;
for(int i = 1; i <= 500000; i++)
{
a++;
}
}
}
Thanks and good day