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

          常用鏈接

          留言簿(6)

          我參與的團隊

          隨筆分類(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
          主站蜘蛛池模板: 独山县| 巴青县| 通榆县| 嵊泗县| 宿迁市| 固安县| 道真| 百色市| 方山县| 岑巩县| 固阳县| 姜堰市| 莆田市| 获嘉县| 攀枝花市| 历史| 长乐市| 姜堰市| 翁牛特旗| 河源市| 项城市| 巴彦淖尔市| 桐庐县| 荃湾区| 东安县| 上虞市| 曲水县| 瑞金市| 乌海市| 邵阳市| 曲沃县| 南漳县| 肇源县| 防城港市| 高淳县| 金沙县| 台安县| 连城县| 南丰县| 萍乡市| 惠州市|