package course.examples.broadcastreceiver.singlebroadcastdynamicregistration;

import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SingleBroadcast extends Activity {

	private static final String CUSTOM_INTENT = "course.examples.BroadcastReceiver.show_toast";
	private final IntentFilter intentFilter = new IntentFilter(CUSTOM_INTENT);
	private final Receiver receiver = new Receiver();

	private LocalBroadcastManager mBroadcastMgr;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		mBroadcastMgr = LocalBroadcastManager
				.getInstance(getApplicationContext());
		mBroadcastMgr.registerReceiver(receiver, intentFilter);

		setContentView(R.layout.main);

		Button button = (Button) findViewById(R.id.button);
		button.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				mBroadcastMgr.sendBroadcast(new Intent(CUSTOM_INTENT));
			}
		});
	}

	@Override
	protected void onDestroy() {
		mBroadcastMgr.unregisterReceiver(receiver);
		super.onDestroy();
	}
}
@@ -1097,16 +1097,118 @@
 ew v) %7B%0A
+%09%09%09%09Intent intent = new Intent(CUSTOM_INTENT);%0A%09%09%09%09intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION);%0A
 %09%09%09%09mBro
@@ -1235,33 +1235,14 @@
 ast(
-new Intent(CUSTOM_INTENT)
+intent
 );%0A%09

add example of Intent.FLAG_DEBUG_LOG_RESOLUTION usage