I accidentally coded my Toast this way and it continues to work.
public class MainActivity extends AppCompatActivity {
private Toast mToast;
...
private void onClickHandler(int itemIndex) {
mToast = new Toast();
mToast.makeText(this, String.valueOf(itemIndex), Toast.LENGTH_SHORT).show();
}
}
Given that makeText is a static method, why would the above work?