Problem in inserting onAttach override method, Tutorial #28

+2 Mohit Jangid · January 4, 2016

Post a Reply


Oldest  Newest  Rating
+2 Gary Whitney · January 5, 2016
That is the same code I used last Summer and it worked for me. But that was 2 APIs ago.

Not sure but this might have something to do with it.

"public void onAttach (Activity activity)
Deprecated. See  onAttach(Context)"

What if you tried.
public void onAttach (Context this)
0 Nicholas Eason · January 5, 2016
What Gary said. If you ever run across a method that is slashed out like this then that means the method is no longer supported and there is a newer, better version of it (aka Deprecated).
0 Mohit Jangid · January 6, 2016
public void onAttach(Context this) is working. 
Thanks Gary and Nicholas
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator