How to stop displaying message from Toast when Application is closed?

前端 未结 5 1359
自闭症患者
自闭症患者 2020-12-05 20:26

This is my sample code:

public class MainActivity extends Activity {

    Button buttonClick;
    @Override
    protected void onCreate(Bundle savedInstanceS         


        
5条回答
  •  臣服心动
    2020-12-05 21:03

    Store a reference to your toast object. In your onDestroy, if the toast is not null then call cancel() on it.

提交回复
热议问题