I\'ve updated the SDK to the latest version (API 23) and the onAttach(Activity)
method for fragment is deprecated. So instead of using that method, now I\'m usi
After I read your answer @David Rauca
I think the second one can solve my problem. But when I look into the source code. I found that actually, onAttach(Context context)
do nothing on Android M, just called the old method.
As a solution:
@SuppressWarnings("deprecation")
Just add it into the old method is the best solution.