2012-02-11 4 views
1

나는 텍스트 변환 지원에 대한 연설과 함께 블랙 베리 사전 응용 프로그램을 만들었습니다. 모두 정상적으로 작동합니다. 지금은 사용자가 내가 그것을 프로그래밍 호야이블랙 베리의 단일 응용 프로그램에서 소리가 나지 않는 경우

use the flag value as reference 


if flag value is true then user click on item then it will play the sound 
else sound wont play and display one dialog that Do you want enable sound with two options yes or no 
      if user click on yes then make flag value as true and item.setText("Voice Disable"); otherwise no action means no changes in flag 
      in your list item click listener write condition as following 
      if(flag==true) 
      { 
       write your logic to play 
      } 

샘플 코드를 시도

답변

0

나에게 도움이 할 수있는 방법에 따라서 필요로 할 때 소리를 해제하고 싶었다

public class app extends UiApplication{ 


    public static void main(String[] args) { 
     new app().enterEventDispatcher(); 
    } 

    public app() { 
     pushScreen(new SampleScreen()); 
    } 
} 
class SampleScreen extends MainScreen 
{ 
    static boolean flag=true; 
    MenuItem item=null; 
    public SampleScreen() { 

//  use the flag value as reference 
//  if flag value is true then user click on item then it will play the sound 
//  else sound wont play and display one dialog that Do you want enable sound with two options yes or no 
//  if user click on yes then make flag value as true and item.setText("Voice Disable"); otherwise no action means no changes in flag 
//  in your list item click listner write condition as following 
//  if(flag==true) 
//  { 
//   write your logic to play 
//  } 



     // you already implement 

     item=new MenuItem("Voice Disable",0,100) { 
      public void run() { 
       if(flag) 
       { 
        flag=false; 
        item.setText("Voice Enable"); 
        UiApplication.getUiApplication().invokeLater(new Runnable() { 
         public void run() { 
          Dialog.inform("Voice Disable succesfully"); 
         } 
        }); 
       }else{ 
        flag=true; 
        item.setText("Voice Disable"); 
        UiApplication.getUiApplication().invokeLater(new Runnable() { 
         public void run() { 
          Dialog.inform("Voice Enable succesfully"); 
         } 
        }); 
       } 

      } 
     }; 
     addMenuItem(item); 

    } 
} 
입니다
관련 문제