Broadcast receiver in Fragment?
<p>I use broadcast receiver, and in Fragment.java i register. But it's not working.
My code: </p>

<pre><code>Intent intent = new Intent("android.intent.action.LOGIN");
intent.putExtra("message", obj.getToken());
intent.setAction("com.sunrise.android.LOGIN");
loginView.getContext().sendBroadcast(intent);
</code></pre>

<p>In Fragment:</p>

<pre><code>@Override
public void onResume() {
    super.onResume();
    informationStudentPresenter = new InformationStudentPresenter(this);
    IntentFilter intentFilter = new IntentFilter("android.intent.action.LOGIN");
    getActivity().registerReceiver(broadcastReceiver, intentFilter);
}
 private final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        Toast.makeText(getActivity(), "CLGT", Toast.LENGTH_SHORT);
    if(intent.getAction().equalsIgnoreCase("com.sunrise.android.LOGIN")){
            if(!"".equals(findToken())) {
                informationStudentPresenter.getProfileStudent();
                informationStudentPresenter.showToast();
            }
       }
    }
};
</code></pre>

<p>Could you tell me where my mistake and how to fix it?
Thanks.</p>