Display Snackbar without CoordinatorLayout

前端 未结 4 1404
清歌不尽
清歌不尽 2021-02-06 00:20

I have Displayed Snackbar using CoordinatorLayout but in some layout i did\'t used CoordinatorLayout layout and i want to display snackbar but faced problem with it.

I h

4条回答
  •  臣服心动
    2021-02-06 00:57

    Try this easy piece of code.. a dummy view from the android framework itself is used

    Snackbar.make(findViewById(android.R.id.content),"Your Text Here",Snackbar.LENGTH_SHORT).show();

提交回复
热议问题