Fragments hang after inserting data

0

I'm having trouble entering information using this code. The process executes and inserts normally, but from there it no longer loads my fragments and is only locked in a white screen. I'm starting with RxJava and I do not even know if the code is correct. Does anyone know how to solve this code or some other solution?

Dao

@Insert( onConflict = OnConflictStrategy.REPLACE )
fun insert( info: Information ) : Long

Repository

fun dbInsert( info: Information ) : Long? {
    return mDatabase?.daoInfo()?.insert( info )
}

RxJava

    Completable.fromRunnable {
        repository.dbInsert( info )
    }
            .subscribeOn( Schedulers.io() )
            .subscribe()

LoadFragment - ViewModel( app: Application ) : AndroidViewModel(app) {

        val fragMgr = supportFragmentManager

        if ( fragMgr.findFragmentByTag( TAG ) != null ) {
            return
        }
        val fragment = getFragment()

        val frgTransaction = fragMgr.beginTransaction()

        frgTransaction
                .replace( R.id.frag, fragment, TAG )
                .setCustomAnimations( android.R.anim.fade_in, android.R.anim.fade_out )
                .commitAllowingStateLoss()
                //.commit()
    
asked by anonymous 28.02.2018 / 19:07

0 answers