I just dealt with this myself, and here's the part that bit me:
In your step 5... It's possible for a user to register for an account with you entirely separate from their Facebook ID, right? Then some other time they log in with Facebook.... And you just created them a second account and lost their first one.
There needs to be a way to be logged in to your web service, then log in to facebook, and capture the association between the facebook ID and the local account.
Apart from that, your plan sounds solid.
Update: Facebook has added a doc outlining such a scenario HERE
One way to do it is by modifying your getView() method of your adapter, so that it uses the ViewHolder pattern (Romain Guy's Google I/O 2009 presentation, look at 0:09:05).
In your view holder that you tag to the view, you can add field for the resource ID.
When you get your selected view, find the view holder (view.getTag()
) and get its ID field.
You can pass it to another Activity by using Intents.
You may have to use ContentProvider so that the second Activity has access to your chosen image. Keep in mind that, more often than not, the resources that are compiled in your .apk and have an ID are small, utility ones, because otherwise they bulk up your application, and most of the time, you can count on using the Internet to download images.
Of course, that's not always the case, but if you are simulating Internet resources with res/drawable resources, chances are, you'll face different problems.
Good luck.
Best Answer
Add him as admin and then remove yourself