Adds helper method to MCFragment to get the AppCompatActivity for the fragment.
This commit is contained in:
		| @@ -1,5 +1,6 @@ | ||||
| package com.majinnaibu.monstercards.ui; | ||||
|  | ||||
| import androidx.appcompat.app.AppCompatActivity; | ||||
| import androidx.fragment.app.Fragment; | ||||
|  | ||||
| import com.majinnaibu.monstercards.MonsterCardsApplication; | ||||
| @@ -13,4 +14,8 @@ public class MCFragment extends Fragment { | ||||
|     protected MonsterRepository getMonsterRepository() { | ||||
|         return this.getApplication().getMonsterRepository(); | ||||
|     } | ||||
|  | ||||
|     public AppCompatActivity requireAppCompatActivity() { | ||||
|         return (AppCompatActivity) requireActivity(); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user