隨筆 - 64  文章 - 9  trackbacks - 0
          <2010年3月>
          28123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          常用鏈接

          留言簿(6)

          我參與的團隊

          隨筆分類(88)

          隨筆檔案(92)

          文章分類(142)

          文章檔案(182)

          天基成員

          學習園

          我的海角

          搜索

          •  

          積分與排名

          • 積分 - 183435
          • 排名 - 319

          最新評論

          1. package lab.sodino.filesys;  
          2. import javax.microedition.io.file.FileSystemListener;  
          3. import javax.microedition.io.file.FileSystemRegistry;  
          4. import javax.microedition.lcdui.Alert;  
          5. import javax.microedition.lcdui.AlertType;  
          6. import javax.microedition.lcdui.Display;  
          7. import javax.microedition.lcdui.Form;  
          8. import javax.microedition.midlet.MIDlet;  
          9. import javax.microedition.midlet.MIDletStateChangeException;  
          10. public class FSListenerDemo extends MIDlet implements FileSystemListener {  
          11.     public FSListenerDemo() {  
          12.         super();  
          13.         Form f = new Form("FSDemo");  
          14.         Display.getDisplay(this).setCurrent(f);  
          15.     }  
          16.     protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {  
          17.     }  
          18.     protected void pauseApp() {  
          19.     }  
          20.     protected void startApp() throws MIDletStateChangeException {  
          21.         FileSystemRegistry.addFileSystemListener(this);  
          22.     }  
          23.     public void rootChanged(int state, String rootName) {  
          24.         if (state == FileSystemListener.ROOT_ADDED) {  
          25.             Alert alert = new Alert("Information""A new card has been mounted, it's name is " + rootName, null,  
          26.                     AlertType.CONFIRMATION);  
          27.             alert.setTimeout(Alert.FOREVER);  
          28.             Display.getDisplay(this).setCurrent(alert);  
          29.         } else if (state == FileSystemListener.ROOT_REMOVED) {  
          30.             Alert alert = new Alert("Information""A new card has been unmounted, it's name is " + rootName, null,  
          31.                     AlertType.CONFIRMATION);  
          32.             alert.setTimeout(Alert.FOREVER);  
          33.             Display.getDisplay(this).setCurrent(alert);  
          34.         }  
          35.     }  
          36. }  
          posted on 2010-03-19 23:05 鵬凌 閱讀(351) 評論(0)  編輯  收藏 所屬分類: java
          主站蜘蛛池模板: 天门市| 绥江县| 二连浩特市| 金阳县| 舞阳县| 德兴市| 潍坊市| 山阳县| 固阳县| 分宜县| 景宁| 大兴区| 中阳县| 苏尼特左旗| 卢氏县| 永丰县| 临邑县| 金川县| 舞钢市| 垣曲县| 阳江市| 手机| 汽车| 云南省| 陆河县| 北海市| 增城市| 福鼎市| 谢通门县| 凌云县| 扬中市| 汶川县| 凌源市| 德庆县| 泗水县| 连城县| 宁都县| 海丰县| 都江堰市| 房山区| 科技|