編輯電子書 - 回調型intent
書名:
型號:
價格:
簡介:
欲取得某一個調用Activity後的回傳參數,可以利用Intent的回調型框架來完成。 Intent啟動端需調用startActivityForResult(intent,requestCode),要求被Intent啟動的Activity需回調參數。 程式碼如下: 接收回傳資料的程式碼如下: 一般會將REQUESTCODE設定為常數。 回呼時再去檢查是否符合。 設定RESULTCODE時,利用常數RESULT_OK。 這樣回傳時,兩階段的檢查應該如下方程式碼才是正確。
內容:
<div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>欲取得某一個調用Activity後的回傳參數,可以利用Intent的回調型框架來完成。</td> </tr> </tbody> </table> </div> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>Intent啟動端需調用startActivityForResult(intent,requestCode),要求被Intent啟動的Activity需回調參數。</td> </tr> </tbody> </table> </div> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>程式碼如下:</td> </tr> </tbody> </table> </div> </div> <div style="font-family: Arial, 新細明體; background-color: rgb(255, 255, 255);"> <table> <tbody> <tr> <td><img id="Img" src="http://www.pcschool.tv/scorm12/class/05183TC1/class800/05183tc1/05183tc1_m8_4/images/2_4_1.jpg" style="height:55px; width:400px" /></td> </tr> <tr> <td> <p> </p> </td> </tr> </tbody> </table> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>接收回傳資料的程式碼如下:</td> </tr> </tbody> </table> </div> </div> <div style="font-family: Arial, 新細明體; background-color: rgb(255, 255, 255);"> <table> <tbody> <tr> <td><img id="Img" src="http://www.pcschool.tv/scorm12/class/05183TC1/class800/05183tc1/05183tc1_m8_4/images/2_4_2.jpg" style="height:188px; width:400px" /></td> </tr> <tr> <td> <p> </p> </td> </tr> </tbody> </table> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>一般會將REQUESTCODE設定為常數。</td> </tr> </tbody> </table> </div> </div> <div style="font-family: Arial, 新細明體; background-color: rgb(255, 255, 255);"> <table> <tbody> <tr> <td><img id="Img" src="http://www.pcschool.tv/scorm12/class/05183TC1/class800/05183tc1/05183tc1_m8_4/images/2_4_3.jpg" style="height:17px; width:400px" /></td> </tr> <tr> <td> <p> </p> </td> </tr> </tbody> </table> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>回呼時再去檢查是否符合。</td> </tr> </tbody> </table> </div> </div> <div style="font-family: Arial, 新細明體; background-color: rgb(255, 255, 255);"> <table> <tbody> <tr> <td><img id="Img" src="http://www.pcschool.tv/scorm12/class/05183TC1/class800/05183tc1/05183tc1_m8_4/images/2_4_4.jpg" style="height:94px; width:400px" /></td> </tr> <tr> <td> <p> </p> </td> </tr> </tbody> </table> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>設定RESULTCODE時,利用常數RESULT_OK。</td> </tr> </tbody> </table> </div> </div> <div style="font-family: Arial, 新細明體; background-color: rgb(255, 255, 255);"> <table> <tbody> <tr> <td><img id="Img" src="http://www.pcschool.tv/scorm12/class/05183TC1/class800/05183tc1/05183tc1_m8_4/images/2_4_5.jpg" style="height:55px; width:400px" /></td> </tr> <tr> <td> <p> </p> </td> </tr> </tbody> </table> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> </div> <div class="txt01" style="line-height: 24px; font-size: 15px; color: rgb(46, 124, 167); font-family: Arial, 新細明體; position: relative; left: 0px; width: 570px; background-color: rgb(255, 255, 255);"> <div class="txt01" style="position: relative; left: 24px; width: 560px;"> <table style="table-layout:fixed; word-break:normal; word-wrap:break-word"> <tbody> <tr> <td>這樣回傳時,兩階段的檢查應該如下方程式碼才是正確。</td> </tr> </tbody> </table> </div> </div> <div style="font-family: Arial, 新細明體; background-color: rgb(255, 255, 255);"> <table> <tbody> <tr> <td><img id="Img" src="http://www.pcschool.tv/scorm12/class/05183TC1/class800/05183tc1/05183tc1_m8_4/images/2_4_6.jpg" style="height:55px; width:400px" /></td> </tr> <tr> <td> <p> </p> </td> </tr> </tbody> </table> </div>
上架
封面圖:
當前封面:
支援格式: JPG, PNG, GIF (最大 2MB)
更新電子書
返回列表