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

          常用鏈接

          留言簿(6)

          我參與的團(tuán)隊(duì)

          隨筆分類(88)

          隨筆檔案(92)

          文章分類(142)

          文章檔案(182)

          天基成員

          學(xué)習(xí)園

          我的海角

          搜索

          •  

          積分與排名

          • 積分 - 184474
          • 排名 - 318

          最新評論

          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 鵬凌 閱讀(356) 評論(0)  編輯  收藏 所屬分類: java
          主站蜘蛛池模板: 淮滨县| 沁水县| 肥城市| 郓城县| 泊头市| 伊金霍洛旗| 吉水县| 苏尼特左旗| 育儿| 任丘市| 绥棱县| 天柱县| 渭南市| 鄂托克旗| 永清县| 高唐县| 横山县| 台东县| 延寿县| 微博| 霍州市| 东至县| 昭觉县| 云龙县| 易门县| 桂阳县| 合阳县| 剑阁县| 潼关县| 精河县| 永川市| 宁国市| 安岳县| 自治县| 鹿邑县| 天柱县| 七台河市| 盐亭县| 镶黄旗| 苗栗县| 廉江市|