Merge pull request #1988 from nextcloud/npeOnGetActivity

use provide activity instead of calling getActivity, which might be null
This commit is contained in:
Andy Scherzinger 2018-01-18 21:26:49 +01:00 committed by GitHub
commit 8933a065d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,7 +167,7 @@ public class ContactsBackupFragment extends FileFragment implements DatePickerDi
view.findViewById(R.id.contacts_backup_now).getBackground()
.setColorFilter(accentColor, PorterDuff.Mode.SRC_ATOP);
AppCompatButton chooseDate = (AppCompatButton) view.findViewById(R.id.contacts_datepicker);
AppCompatButton chooseDate = view.findViewById(R.id.contacts_datepicker);
chooseDate.getBackground().setColorFilter(accentColor, PorterDuff.Mode.SRC_ATOP);
chooseDate.setTextColor(ThemeUtils.fontColor());
@ -203,7 +203,7 @@ public class ContactsBackupFragment extends FileFragment implements DatePickerDi
@Override
protected Boolean doInBackground(String... path) {
FileDataStorageManager storageManager = new FileDataStorageManager(account,
getActivity().getContentResolver());
contactsPreferenceActivity.getContentResolver());
OCFile folder = storageManager.getFileByPath(path[0]);