Skip to content

Commit

Permalink
Fix newInstance deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
Xcreen committed Dec 16, 2024
1 parent 3ffc017 commit be422bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/net/xcreen/restsms/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
//Set Home Fragment
val fragmentTransaction = supportFragmentManager.beginTransaction()
try {
val homeFragment: Fragment = HomeFragment::class.java.newInstance()
val homeFragment: Fragment = HomeFragment::class.java.getDeclaredConstructor().newInstance()
fragmentTransaction.replace(R.id.main_framelayout, homeFragment).commit()
} catch (ex: Exception) {
ex.printStackTrace()
Expand Down

0 comments on commit be422bf

Please sign in to comment.