Android Question ERROR Amir_Fragments. Don't work!

Paolodc

Member
From this tutorial:
https://www.b4x.com/android/forum/threads/amir_fragment.101189/

I've downloaded the basic project and I haven't changed anything. It made an error from Compiler.

The lines from where the error is made are these:
B4X:
Public Sub LoadFragment (FragmentIndex As Int,throwIfSelectedBefore As Boolean)
    If throwIfSelectedBefore Then
        If FragmentIndex=SelectedFragment Then Return
    End If
    Dim Fragment As Amir_Fragment
    Dim FT As Amir_FragmentTransaction
    FT.Initialize
    Select FragmentIndex
        Case 1
            Dim First As FirstFragment
            First.Initialize
            Fragment=First.Fragment
        Case 2
            Dim Second As SecondFragment
            Second.Initialize
            Fragment=Second.Fragment
    End Select
    If throwIfSelectedBefore Then
    SetAnimation(FT,FragmentIndex,SelectedFragment)
    Else
        FT.Transition=FT.TRANSIT_NONE
    End If
    FT.Replace3(Content,Fragment)' <--------- It makes an error
    FT.Commit
    SelectedFragment=FragmentIndex
End Sub

The error is this:
B4X:
Compiling generated Java code.    Error
B4A line: 104
FT.Replace3(Content,Fragment)' <--------- It make
src\com\aghajari\fragments\basic\main.java:496: error: cannot access Fragment
_ft.Replace3((android.view.View)(mostCurrent._content.getObject()),(com.aghajari.fragments.Fragment)(_fragment.getObject()));
                                                                                                                        ^
  class file for android.support.v4.app.Fragment not found


Can I get help? Actually, I don't know how to find the solution for it.
@alimanam3386, please!
 

Paolodc

Member
SOLVED. For whose have this library need to get the new version: 2.0V. After adding that you have to run Jetifier. Then, it's work!
 
Upvote 0
Top