So I'm trying to make AOuth work in android for twitter. Here's the code 
I'm having errors with in my activity:

@Overridepublic Loader<OAuthConsumer> onCreateLoader(int id, Bundle arg1) {

    consumerLoader = new getCommonsHttpOAuthConsumer(); //consumerLoader is 
declared in the activity as "private Loader<OAuthConsumer> consumerLoader;"
    return consumerLoader;
        // After this method you're going in loadInBackground()}


Here's the code for my asyncTaskLoader:

class getCommonsHttpOAuthConsumer extends AsyncTaskLoader<OAuthConsumer>{

        public getCommonsHttpOAuthConsumer(Context context) {
                super(context);
                // TODO Auto-generated constructor stub
        }

        @Override
        public OAuthConsumer loadInBackground() {
                // TODO Auto-generated method stub
                
                return new CommonsHttpOAuthConsumer(Constants.CONSUMER_KEY, 
Constants.CONSUMER_SECRET);
        }
        }

This is a 2 part question. 1st question: I get an error when I use *import 
android.support.v4.app.LoaderManager* The error is on *Loader<OAuthConsumer>
*. It says "The return type is incompatible with 
LoaderManager.LoaderCallbacks.onCreateLoader(int, Bundle)". But the error 
goes away if I use *import android.app.LoaderManager *instead. My question 
is: Should I try to fix the error with using the support library, so that 
more devices will be compatible with my app? If yes, how can I fix that 
error?

 

2nd question: No matter what import I use, I get an error on *new 
getCommonsHttpOAuthConsumer();* The error says: "Type mismatch: cannot 
convert from getCommonsHttpOAuthConsumer to Loader". What am I doing wrong?



-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to