반응형
rss 아이콘 이미지

스레드 (thread) 안에서 toast 사용하기

카테고리 없음 2023. 3. 3. 14:48 Posted by 법당오빠
반응형

public void postToastMessage(final String message) {

        Handler handler = new Handler(Looper.getMainLooper());

        handler.post(new Runnable() {

            @Override

            public void run() {

                Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show();

            }

        });

    }

 
반응형