久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='GawaS'></bdo><ul id='GawaS'></ul>

  • <legend id='GawaS'><style id='GawaS'><dir id='GawaS'><q id='GawaS'></q></dir></style></legend>

      <i id='GawaS'><tr id='GawaS'><dt id='GawaS'><q id='GawaS'><span id='GawaS'><b id='GawaS'><form id='GawaS'><ins id='GawaS'></ins><ul id='GawaS'></ul><sub id='GawaS'></sub></form><legend id='GawaS'></legend><bdo id='GawaS'><pre id='GawaS'><center id='GawaS'></center></pre></bdo></b><th id='GawaS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GawaS'><tfoot id='GawaS'></tfoot><dl id='GawaS'><fieldset id='GawaS'></fieldset></dl></div>
      1. <tfoot id='GawaS'></tfoot>
      2. <small id='GawaS'></small><noframes id='GawaS'>

        在Android上將字符串轉換為整數

        Converting a string to an integer on Android(在Android上將字符串轉換為整數)

          <tbody id='J9J3O'></tbody>

          • <bdo id='J9J3O'></bdo><ul id='J9J3O'></ul>
            • <i id='J9J3O'><tr id='J9J3O'><dt id='J9J3O'><q id='J9J3O'><span id='J9J3O'><b id='J9J3O'><form id='J9J3O'><ins id='J9J3O'></ins><ul id='J9J3O'></ul><sub id='J9J3O'></sub></form><legend id='J9J3O'></legend><bdo id='J9J3O'><pre id='J9J3O'><center id='J9J3O'></center></pre></bdo></b><th id='J9J3O'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='J9J3O'><tfoot id='J9J3O'></tfoot><dl id='J9J3O'><fieldset id='J9J3O'></fieldset></dl></div>

              <tfoot id='J9J3O'></tfoot>

                  <legend id='J9J3O'><style id='J9J3O'><dir id='J9J3O'><q id='J9J3O'></q></dir></style></legend>
                1. <small id='J9J3O'></small><noframes id='J9J3O'>

                2. 本文介紹了在Android上將字符串轉換為整數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  如何將字符串轉換為整數?

                  How do I convert a string into an integer?

                  我有一個文本框讓用戶輸入一個數字:

                  I have a textbox I have the user enter a number into:

                  EditText et = (EditText) findViewById(R.id.entry1);
                  String hello = et.getText().toString();
                  

                  并將值賦給字符串hello.

                  我想把它轉換成一個整數,這樣我就可以得到他們輸入的數字;稍后將在代碼中使用.

                  I want to convert it to a integer so I can get the number they typed; it will be used later on in code.

                  有沒有辦法讓 EditText 變成一個整數?那將跳過中間人.如果沒有,字符串轉整數就可以了.

                  Is there a way to get the EditText to a integer? That would skip the middle man. If not, string to integer will be just fine.

                  推薦答案

                  查看 Integer 類和靜態 parseInt() 方法:

                  See the Integer class and the static parseInt() method:

                  http://developer.android.com/reference/java/lang/整數.html

                  Integer.parseInt(et.getText().toString());
                  

                  您需要捕獲 NumberFormatException 以防在解析時出現問題,因此:

                  You will need to catch NumberFormatException though in case of problems whilst parsing, so:

                  int myNum = 0;
                  
                  try {
                      myNum = Integer.parseInt(et.getText().toString());
                  } catch(NumberFormatException nfe) {
                     System.out.println("Could not parse " + nfe);
                  } 
                  

                  這篇關于在Android上將字符串轉換為整數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)

                      <i id='uEgud'><tr id='uEgud'><dt id='uEgud'><q id='uEgud'><span id='uEgud'><b id='uEgud'><form id='uEgud'><ins id='uEgud'></ins><ul id='uEgud'></ul><sub id='uEgud'></sub></form><legend id='uEgud'></legend><bdo id='uEgud'><pre id='uEgud'><center id='uEgud'></center></pre></bdo></b><th id='uEgud'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uEgud'><tfoot id='uEgud'></tfoot><dl id='uEgud'><fieldset id='uEgud'></fieldset></dl></div>
                        <bdo id='uEgud'></bdo><ul id='uEgud'></ul>
                          • <legend id='uEgud'><style id='uEgud'><dir id='uEgud'><q id='uEgud'></q></dir></style></legend>

                          • <small id='uEgud'></small><noframes id='uEgud'>

                              <tbody id='uEgud'></tbody>
                            <tfoot id='uEgud'></tfoot>
                            主站蜘蛛池模板: 99热精品久久 | 精品久久久久久亚洲精品 | 成人免费看片又大又黄 | 午夜影视在线观看 | 日本成人中文字幕 | 久久久久久久久91 | 亚洲综合小视频 | 完全免费av在线 | 激情五月婷婷丁香 | 欧美一级久久 | 欧美精品久久久久久久久久 | 欧美日韩国产综合在线 | 日韩三级免费观看 | 91九色在线观看 | 成人在线视频观看 | 国产伦精品一区二区三区视频金莲 | 亚洲一区二区三区福利 | 久草青青草 | 亚洲91精品 | 日韩中文av在线 | 日韩五月天 | 免费一级欧美在线观看视频 | 久久爱综合 | 久久9999久久 | 久久国产精品99久久久久 | 91av免费看 | 国产精品毛片无码 | a欧美 | 天天天天操 | 久久精品高清视频 | 国产一级网站 | 特一级毛片 | 色综合99| 欧洲在线视频 | 国产黄色麻豆视频 | 国产日韩一区二区三区 | 午夜精品久久久久久久久久久久久 | 欧美一区二区免费 | 国产成人精品久久二区二区91 | 精品视频在线观看 | 性生活毛片 |