向OnsuccessListener
FirebaseInstanceId
添加Activity closes without any stack traces.
No exception is visible
时遇到问题。
以下是添加到“活动"onCreate"
”生命周期方法中的代码:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//... snip
FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(new OnSuccessListener<InstanceIdResult>() {
@Override
public void onSuccess(InstanceIdResult instanceIdResult) {
String instanceIdToken = instanceIdResult.getToken();
}
});
这可能是什么原因造成的?