This is what I see in Android Studio:
While this is actually the real code :
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode != RequestCodes.CRED_HINT || resultCode != Activity.RESULT_OK) { return; }
setResult(Resource.<User>forLoading());
final Credential credential = data.getParcelableExtra(Credential.EXTRA_KEY);
final String email = credential.getId();
ProviderUtils.fetchTopProvider(getAuth(), getArguments(), email)
.addOnCompleteListener(new OnCompleteListener<String>() {
@Override
public void onComplete(@NonNull Task<String> task) {
if (task.isSuccessful()) {
setResult(Resource.forSuccess(new User.Builder(task.getResult(), email)
.setName(credential.getName())
.setPhotoUri(credential.getProfilePictureUri())
.build()));
} else {
setResult(Resource.<User>forFailure(task.getException()));
}
}
});
}
How can I stop Anroid Studio from doing this? And by which rules at all does Android Studio this shortening?
Cant close this as a duplicate of this so I'll just put the answer here (edited) for future reference:
You can disable code folding in the Settings menu of Android Studio, un-tick the "Closures" and "Generic constructor and method parameters" boxes under Editor → General → Code Folding :
As for the reason the screenshot has the answer, but its set to fold "Closures" which are anonymous inner classes with 1 method as well as "Generic constructor and method parameters" .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.