title: Can not pass firebase cloud messeging token from one class to another by using intent
body: <p>I am not able to pass the refreshed token that is generated in fmctoken.java class to mainActivity.java class by using intent. Please someone help me to solve this out.</p>
  
  <p>my mainactivity.java class is:</p>
  
  <pre><code>package com.example.htcm.firebase_fmc_token;
  
  import android.content.Intent;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.TextView;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  
  public class MainActivity extends AppCompatActivity {
      public TextView txtvu;
      public DatabaseReference mdatabase;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          txtvu=(TextView)findViewById(R.id.textvu1);
          //String token=getIntent().getExtras().getString("firetoken");
          String value = getIntent().getStringExtra("tokengenerated");
          Log.d("token", "my tiken: " + value);
          txtvu.setText(value);
  
      }
  }
  </code></pre>
  
  <p>and my fmctoken.java class is:</p>
  
  <pre><code>package com.example.htcm.firebase_fmc_token;
  
  import android.content.Intent;
  import android.util.Log;
  import android.content.Intent;
  import com.google.firebase.iid.FirebaseInstanceId;
  import com.google.firebase.iid.FirebaseInstanceIdService;
  
  public class fmctoken extends FirebaseInstanceIdService {
      public void onTokenRefresh() {
          String refreshedToken = FirebaseInstanceId.getInstance().getToken();
          Log.d("myfirebaseId", "Refreshed token: " + refreshedToken);
          Intent intent = new Intent(getApplicationContext(), MainActivity.class);
          intent.putExtra("tokengenerated", refreshedToken);
          startActivity(intent);
      }
  }
  </code></pre>