CrashAnalytics Added

This commit is contained in:
smileomi18@gmail.com
2023-08-23 17:12:05 +05:30
parent 6c0e7dc31d
commit be78cff112
5 changed files with 44 additions and 12 deletions

View File

@@ -14,5 +14,6 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
}
}

View File

@@ -8,6 +8,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.Toast
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
@@ -42,6 +43,21 @@ class UserListFragment : BaseFragment() {
sharedPreference = requireContext().getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
setupViews()
return binding.root
//
// val view = inflater.inflate(R.layout.fragment_user_list, container, false)
//
// val crashButton = Button(requireContext())
// crashButton.text = "Test Crash"
// crashButton.setOnClickListener {
// throw RuntimeException("Test Crash") // Force a crash
// }
//
// val layout = view.findViewById<ViewGroup>(R.id.fragment_layout)
// layout.addView(crashButton, ViewGroup.LayoutParams(
// ViewGroup.LayoutParams.MATCH_PARENT,
// ViewGroup.LayoutParams.WRAP_CONTENT))
//
// return view
}
override fun onResume() {

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
@@ -6,7 +9,13 @@
android:layout_height="match_parent"
android:padding="24dp"
tools:context="com.example.hposregistration.ui.fragments.UserListFragment">
<LinearLayout
android:visibility="gone"
android:id="@+id/fragment_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<TextView
android:id="@+id/tv_title"
style="@style/title1"
@@ -75,4 +84,6 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>