2
我有一個Toast消息,我用它作爲啓動屏幕,我希望在關閉時添加回調。這在Android中如何實現?Toast消息關閉時添加回調
// Splash
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.splash, (ViewGroup) findViewById(R.id.frameLayout1));
layout.setBackgroundColor(Color.WHITE);
Toast toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
toast.show();
@Nissan,謝謝你的接受。你能否詳細說明哪種方法適合你? –