0

I'm trying to get this app (my first app) with a load of fragments to work. I analyse the code and all is OK except for depreciation of FragmentManager. App is building OK but can't run in emulator

I've tried clicking the light bulbs but am still in the dark. Looked at the developer.android pages but brain has turned to jelly and am not getting it. Am never sure if the dev pages are showing me outdated info as I got the code I'm currently using from there.

public SectionsPagerAdapter(Context context, FragmentManager fm) {<br>
    super(fm);<br>
    mContext = context;
}

And my imports:

import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

I've uploaded a screenshot of results at link below. Please help. If possible just say which line needs to be replaced and with what. Thanks in advance. NTH

https://isthisyourface.wixsite.com/helpnadswithcode

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
nadiaH
  • 1
  • 2
  • If by "can't run in emulator", you mean it's crashing, you'll need to look at [the stack trace](https://stackoverflow.com/a/23353174) to determine the cause of the crash. – Mike M. Nov 11 '19 at 11:41
  • Thank you, have still not solved but I hadn't used stack trace before and so is helpful to know it's there and learn its usefulness :) – nadiaH Nov 11 '19 at 12:50
  • You can [edit] your question to add the stack trace here, if you'd like, so we can have a look. – Mike M. Nov 11 '19 at 12:54
  • Hi again. Yesterday I had the stack trace but today Android Studio has updated and I can't find it. Will keep trying and come back once I have more info to share. Thank you :) – nadiaH Nov 12 '19 at 18:47

1 Answers1

1

user v4.app.FragmentPagerAdapter

Aniruddh Ambarkar
  • 1,030
  • 1
  • 11
  • 20
  • Thanks Aniruddh, I have this in my .gradle file:implementation 'androidx.legacy:legacy-support-v4:1.0.0' How/where will I place: 'v4.app.FragmentPagerAdapter? In the PagerAdapter.java file or the MainActivity.java? – nadiaH Nov 11 '19 at 12:36