2013-05-28 3 views

답변

-1

,

및 매니페스트에},이처럼 버튼 이벤트를 수신

public class YourBoardcastReceiver extends BroadcastReceiver { 
    public void onReceive(Context context, Intent intent) { 
    if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) { 
     /* handle media button intent here by reading contents */ 
     /* of EXTRA_KEY_EVENT to know which key was pressed */ 
    } 
} 

을 방송 수신기를 만들기

<receiver android:name="YourBoardcastReceiver"> 
      <intent-filter> 
        <action android:name="android.intent.action.SCREEN_ON" /> 
      </intent-filter> 

관련 문제