It belongs to the Fragment which invokes the DialogFragment
findViewById
looks for a view with the id in the current view hierarchy. The TextView
is not a child of TimerView
.
So you need to initialize TextView
in Fragment not DialogFragment
.
All Fragment-to-Fragment communication is done through the associated Activity. Two Fragments should never communicate directly. Use interface as a call back to the Activity and then communciate the time to the Fragment.
http://developer.android.com/training/basics/fragments/communicating.html
DialogFragment --> ParentActivtiy --> Fragment
You can check the example @