import android.view.View;
import androidx.appcompat.widget.Toolbar;
-import androidx.lifecycle.ViewModelProviders;
+import androidx.lifecycle.ViewModelProvider;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
Objects.requireNonNull(getSupportActionBar())
.setDisplayHomeAsUpEnabled(true);
- model = ViewModelProviders.of(this)
- .get(NewTransactionModel.class);
+ model = new ViewModelProvider(this).get(NewTransactionModel.class);
}
@Override
protected void initProfile() {
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
-import androidx.lifecycle.ViewModelProviders;
+import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
"getActivity() returned null within onActivityCreated()");
list = activity.findViewById(R.id.new_transaction_accounts);
- viewModel = ViewModelProviders.of(activity)
- .get(NewTransactionModel.class);
+ viewModel = new ViewModelProvider(activity).get(NewTransactionModel.class);
mProfile = Data.profile.getValue();
listAdapter = new NewTransactionItemsAdapter(viewModel, mProfile);
list.setAdapter(listAdapter);