亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Toasts | Android Developers

系統 2247 0

Toasts | Android Developers

The Basics


First, instantiate a Toast object with one of the makeText() methods. This method takes three parameters: the application Context , the text message, and the duration for the toast. It returns a properly initialized Toast object. You can display the toast notification with show() , as shown in the following example:

      
        Context
      
      
         context 
      
      
        =
      
      
         getApplicationContext
      
      
        ();
      
      
      
      
        CharSequence
      
      
         text 
      
      
        =
      
      
      
      
        "Hello toast!"
      
      
        ;
      
      
      
      
        int
      
      
         duration 
      
      
        =
      
      
      
      
        Toast
      
      
        .
      
      
        LENGTH_SHORT
      
      
        ;
      
      
      
      
        Toast
      
      
         toast 
      
      
        =
      
      
      
      
        Toast
      
      
        .
      
      
        makeText
      
      
        (
      
      
        context
      
      
        ,
      
      
         text
      
      
        ,
      
      
         duration
      
      
        );
      
      
        
toast
      
      
        .
      
      
        show
      
      
        ();
      
    

This example demonstrates everything you need for most toast notifications. You should rarely need anything else. You may, however, want to position the toast differently or even use your own layout instead of a simple text message. The following sections describe how you can do these things.

You can also chain your methods and avoid holding on to the Toast object, like this:

Toasts | Android Developers


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 最新欧美精品一区二区三区不卡 | 欧美色操 | 关婷哪一级毛片高清免费看 | 奇米影视四色7777 | 久久国产精品夜色 | 日本中文字幕在线观看视频 | 久久精品国产亚洲a | 毛片视| 国产在线免 | 妖精视频在线看免费视频 | 午夜小视频网站 | 性生活一级毛片 | 国产精品一区高清在线观看 | 一级毛片美国一级j毛片不卡 | 成人小视频在线观看 | 99热99热| 亚洲爱爱视频 | 狠狠干.com | 很很色在线视频 | 婷婷春色 | 四虎最新紧急入口 | 日本精品99| 久久网免费视频 | 国内精品久久久久影院网站 | 日本久久精品视频 | 亚洲第一中文字幕 | 国产高清国内精品福利 | 色涩亚洲 | 天天干天天射天天插 | 久久成人在线观看 | 99久久国产综合精品女不卡 | 泰国理论片 | 国产精品午夜在线观看 | 特黄特色大片免费播放器999 | 91在线免费看 | 色综合一区二区三区 | 国产精品一区二区三区免费视频 | 国产成人香蕉 | 欧美日韩一区二区视频免费看 | 亚洲狠狠婷婷综合久久久久 | 人人澡人人澡人人看欧美 |