parse-community / ParseUI-Android

ParseUI contains user interface libraries for building apps with the Parse Android SDK.
Other
592 stars 324 forks source link

Error:(124, 20) error: incompatible types: Context cannot be converted to Activity #116

Closed mishrakrishnakant closed 8 years ago

mishrakrishnakant commented 8 years ago

So I am getting the above error which clearly has to do with the fact that this is a fragment and not an activity but I am not sure why though.

These are the lines of code where there is the error

@Override
public void onAttach(Context context) {
  super.onAttach(context);

I have no idea what is wrong where, the rest of the code works perfectly fine. The error is in ParseLoginFragment.java

lems111 commented 8 years ago

Hello, Looking at your sample code, I don't see how you would get that error; but, I can tell you that when I use that override function to register my activity as a listener, it doesn't work. There is a deprecated version of this function that I still use to get around that problem which passes the activity object that I can cast as my listener object.

mishrakrishnakant commented 8 years ago

The override was there by default. I removed it and cleaned it 2-3 times, (I don't know why that was required) but it worked so thanks for the help.

I am closing this issue now.

tcx02 commented 2 years ago

i have the same issues but tried to delete the ovveride but the problem is still there image