2011-03-18 2 views
0

중 하나는 .... 그것을 달성하기 위해 도와주세요 android.currently 내가 Android2.3.1 일하고 로컬 알림을 달성하는 방법을 사전에안드로이드 2.3.1에서 로컬 알림을 달성하는 방법?

감사합니다 ---

+0

브로드 캐스트 알림을 보내시겠습니까? 또는 사용자에게 알리는 작은 메시지를 올리면됩니까? – Phobos

+0

알림을 푸시 할 것인가? – Venky

+0

@phobos 그냥 현재 응용 프로그램 화면에 메시지 상자를 표시하고 싶습니다. 나중에 단추를 넣으려고합니다. – Smith

답변

2

나는 당신의 의견에서 같다을 알고 알림이 아닌 대화 상자를 찾고 있습니다. 이 코드는 예 및 아니오 버튼이있는 대화 상자를 제공합니다.

AlertDialog.Builder builder = new AlertDialog.Builder(this); 
    builder.setMessage("Put your question here?") 
    .setCancelable(false) 
    .setPositiveButton("Yes", new DialogInterface.OnClickListener() { 
     public void onClick(DialogInterface dialog, int id) { 
      // put your code here 
     } 
    }) 
    .setNegativeButton("No", new DialogInterface.OnClickListener() { 
     public void onClick(DialogInterface dialog, int id) { 
      // put your code here 
      dialog.cancel(); 
     } 
    }); 
    AlertDialog alertDialog = builder.create(); 
    alertDialog.show(); 
관련 문제