I want to port an AppcompatActivity to a BaseActivity.
I tried to do so but I was unable to solve. I am new to android developemnt.
is it possible to do so? or I will have to do it othe way.
But I am unable to do so.
here is my code :
class MainActivity : BaseActivity() {
private var dataFire: DataFire? = null
private val mViewInflate: View? = null
private val mRtcEngine: RtcEngine? = null
private val mMuted = false
private val TAG = VideoCallActivity::class.java.simpleName
private var video_room_id: String? = null
private val final_room_id: Long = 0
private val tvUsernameVideoChat: TextView? = null
var userIDvisited: String? = null
private val videoFragment = VideoFragment.newInstance()
override fun getLayoutId() = R.layout.main_activity
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
try {
if (savedInstanceState == null) {
getReplaceFragmentTransaction(R.id.fragmentContainer, videoFragment, VideoFragment.TAG).commit()
}
} catch (e: Exception) {
Log.e("name_MainActivity", e.message.toString())
}
}
override fun onBackPressed() {
super.onBackPressed()
//Todo: endCall()
RtcEngine.destroy()
}
}
thanks in advance.