2016-02-04 41 views

回答

1

如果你想檢查是否有啓動請求,使用try-catch塊類似以下內容:

function checkLaunchRequest() { 
     var appControl 
     , appOperation 
     , tmp 
     ; 

     try { 
      appControl = app.getCurrentApplication().getRequestedAppControl().appControl; 
      appOperation = appControl.operation; 
      console.log("checkLaunchRequest operation: " + appOperation); 

      if (appOperation.indexOf("http://tizen.org/appcontrol/operation/view") !== -1) { 
       ...Do something here... 
      } 
     } catch (err) { 
      console.error("Invalid launch request: " + err.message); 
     } 
    } 

還要確保您已在config.xml中設置正確的權限。您需要設置「http://tizen.org/privilege/application.launch」。

相關問題