Reputation: 327
Below is code
String messageToken = FirebaseInstanceId.getInstance().getToken();
SharedPreferences sharedPreferences = getSharedPreferences(Constants.USER_INFO_PREFERENCE,
Context.MODE_PRIVATE);
String userEmail = sharedPreferences.getString(Constants.USER_EMAIL,"");
if (!userEmail.equals("")) {
Log.i(TAG,userEmail);
} else {
Log.i(TAG,"Nao ha info");
}
if (messageToken!=null && !userEmail.equals("")) {
DatabaseReference tokenReference = FirebaseDatabase.getInstance().getReference()
.child(Constants.FIREBASE_PATH_USER_TOKEN).child(Constants.encodeEmail(userEmail));
tokenReference.child("token").setValue(messageToken);
Log.i(InboxActivity.class.getSimpleName(),messageToken);
}
I have no idea why any of the Log.i
is not printing in the log.
Upvotes: 0
Views: 5737
Reputation: 147
Run -> Edit Configurations -> Android app -> app -> Miscellaneous -> Tick all the check boxes -> Apply
Hope this help.
Upvotes: 1
Reputation: 327
I got this problem solved! Matheus Brandino, from Alura.com.br, just pointed me that I had a wrongly overriden the onCreate method (its not showing here because I had my original post edited). So the solution was to delete the second argument from onCreate.
I had:
public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
Now:
public void onCreate(Bundle savedInstanceState) {
Upvotes: 1
Reputation: 1626
Try going to developer settings on your android phone, Find "Monitoring" Option and then "Enable OpenGL Traces" and then select LogCat.
Upvotes: 0
Reputation: 146
Maybe it's because of your build type , logs are not displayed in release mode
Upvotes: 2