Problem in inserting onAttach override method, Tutorial #28

+2 Mohit Jangid · January 4, 2016
/images/forum/upload/2016-01-04/e81f03aad3352261eaa4be88335ab5ce.PNG/images/forum/upload/2016-01-04/5e34ddd3aa78557e5fc12bc308bdc40d.PNG

Post a Reply

Replies

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

106,964 followers
About

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

Links
Moderators
Bucky Roberts Administrator