代码已经整理好,效果如下图:

    wKiom1ccUqPzb2wTAACPYwBAC9E727.png


    地址:http://down.51cto.com/data/2213924


    

// 广播方法

// sendBroadcast(new Intent("you"));


// GerenziliaoActivity.this.finish();


// 广播

private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {

@Override

public void onReceive(Context context, Intent intent) {

// TODO Auto-generated method stub

finish();

}

};

                                                


@Override

protected void onResume() {

// TODO Auto-generated method stub

super.onResume();


IntentFilter intentFilter = new IntentFilter();

intentFilter.addAction("fuckyou");

registerReceiver(broadcastReceiver, intentFilter);

}