File tree Expand file tree Collapse file tree
owncloudApp/src/main/java/com/owncloud/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,10 +37,20 @@ ownCloud admins and users.
3737
3838## Summary
3939
40+ * Bugfix - Crash from Google Play Console in TransferListFragment: [ #4650 ] ( https://github.com/owncloud/android/issues/4650 )
4041* Bugfix - Mini-fab for creating new document not always available: [ #7277 ] ( https://github.com/owncloud/enterprise/issues/7277 )
4142
4243## Details
4344
45+ * Bugfix - Crash from Google Play Console in TransferListFragment: [ #4650 ] ( https://github.com/owncloud/android/issues/4650 )
46+
47+ In order to prevent app crashes, the account parameter from TransferListFragment
48+ has been removed and the newInstance method has been created to pass parameters
49+ safely.
50+
51+ https://github.com/owncloud/android/issues/4650
52+ https://github.com/owncloud/android/pull/4652
53+
4454* Bugfix - Mini-fab for creating new document not always available: [ #7277 ] ( https://github.com/owncloud/enterprise/issues/7277 )
4555
4656 The productName property has been made nullable to handle cases where it is not
Original file line number Diff line number Diff line change 1+ Bugfix: Crash from Google Play Console in TransferListFragment
2+
3+ In order to prevent app crashes, the account parameter from TransferListFragment has
4+ been removed and the newInstance method has been created to pass parameters safely.
5+
6+ https://github.com/owncloud/android/issues/4650
7+ https://github.com/owncloud/android/pull/4652
Original file line number Diff line number Diff line change @@ -47,14 +47,12 @@ import org.koin.androidx.viewmodel.ext.android.viewModel
4747import org.koin.core.parameter.parametersOf
4848import java.io.File
4949
50- class TransferListFragment (
51- private val account : Account
52- ) : Fragment() {
50+ class TransferListFragment : Fragment () {
5351
5452 private val transfersViewModel by viewModel<TransfersViewModel >()
5553 private val capabilityViewModel: CapabilityViewModel by viewModel {
5654 parametersOf(
57- account.name ,
55+ requireArguments().getString( ARG_ACCOUNT_NAME ) ,
5856 )
5957 }
6058
@@ -141,4 +139,16 @@ class TransferListFragment(
141139 }
142140 transfersAdapter.setData(transfersWithSpace)
143141 }
142+
143+ companion object {
144+ private const val ARG_ACCOUNT_NAME = " ACCOUNT_NAME"
145+
146+ @JvmStatic
147+ fun newInstance (account : Account ): TransferListFragment {
148+ val args = Bundle ().apply {
149+ putString(ARG_ACCOUNT_NAME , account.name)
150+ }
151+ return TransferListFragment ().apply { arguments = args }
152+ }
153+ }
144154}
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ protected void onCreate(Bundle savedInstanceState) {
9494
9595 private void createUploadListFragment () {
9696 //UploadListFragment uploadList = new UploadListFragment();
97- TransferListFragment uploadList = new TransferListFragment (getAccount ());
97+ TransferListFragment uploadList = TransferListFragment . newInstance (getAccount ());
9898 FragmentTransaction transaction = getSupportFragmentManager ().beginTransaction ();
9999 transaction .add (R .id .left_fragment_container , uploadList , TAG_UPLOAD_LIST_FRAGMENT );
100100 transaction .commit ();
You can’t perform that action at this time.
0 commit comments