구글링을 하던중에 원하는 결과가 나와서 한번 실행해보았는데
버튼1은 되는데 버튼2는 실행이 안됩니다 ..
전자는 액티비티를 이용했고 후자는 브로드캐스트를 이용했는데 후자가 말썽이네요 .. 아무래도 제가 사용을 잘 못한것 같습니다 ..도와주세요
코드를 보여드리겠습니다.
Intent moveSendMessageIntent = new Intent ( this , Message_Send_Activity. class );
Intent exitApplication = new Intent( "shutDown_Application" );
PendingIntent pendingMoveSendMessageIntent = PendingIntent.getActivity( this , 0 ,moveSendMessageIntent, 0 );
PendingIntent pendingFinishApplicationIntent = PendingIntent.getBroadcast( this , 0 ,exitApplication, 0 );
views.setOnClickPendingIntent(R.id.moveSendMessage,pendingMoveSendMessageIntent);
views.setOnClickPendingIntent(R.id.finishApplication,pendingFinishApplicationIntent);
|
다음은 브로드캐스트리시버를 등록한 메니페스트 코드입니다.
<receiver android:name= ".libs.utils.FinishApp" >
<intent-filter>
<action android:name= "shutDown_Application" ></action>
</intent-filter>
</receiver>
|
마지막으로 브로드캐스트리시버 입니다.
public class FinishApp extends BroadcastReceiver {
BroadcastReceiver mReceiver;
@Override
public void onReceive(Context context, Intent intent) {
BroadcastReceiver finishApp = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
System.out.println( "@@@@@@@@@@@@@@@@@@@@@@@@@@@@" );
}
};
}
}
|
그냥 화면에 출력해보는것도 실행이 안되서요.. 어디서부터가 잘못되었는지 알고싶습니다 ..