daily49er.android.app
Class FacebookShare

java.lang.Object
  extended by Activity
      extended by daily49er.android.app.FacebookShare

public class FacebookShare
extends Activity

Implementation for posting an article to the user's Facebook "wall". In order to make this class work, you'll need to create a new project that contains facebook SDK files and reference it to this project.

Author:
Alex Chavez

Constructor Summary
FacebookShare()
           
 
Method Summary
 void onActivityResult(int requestCode, int resultCode, Intent data)
          No clue what this does, it's used by the Facebook API.
 void onCreate(Bundle savedInstanceState)
          Called when the activity is first created.
 boolean restoreCredentials(Facebook facebook)
          Retrieve and restore the user's Facebook login credentials from the app's shared preferences.
 boolean saveCredentials(Facebook facebook)
          Saves the user's authenticated Facebook login credentials.
static void setUrl(java.lang.String url)
          The URL is set in Article.java as it is the ciurrent article being viewed.
 void updateStatus()
          Creates and displays a Facebook dialog with the URL set; the dialog gives the user the option to enter a message into the text field.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacebookShare

public FacebookShare()
Method Detail

setUrl

public static void setUrl(java.lang.String url)
The URL is set in Article.java as it is the ciurrent article being viewed.

Parameters:
url - - the URL that will be posted in the user's Facebook wall.

onCreate

public void onCreate(Bundle savedInstanceState)
Called when the activity is first created.


updateStatus

public void updateStatus()
Creates and displays a Facebook dialog with the URL set; the dialog gives the user the option to enter a message into the text field.


onActivityResult

public void onActivityResult(int requestCode,
                             int resultCode,
                             Intent data)
No clue what this does, it's used by the Facebook API.


saveCredentials

public boolean saveCredentials(Facebook facebook)
Saves the user's authenticated Facebook login credentials.

Parameters:
facebook - - an instantiated facebook object
Returns:
the saved credentials

restoreCredentials

public boolean restoreCredentials(Facebook facebook)
Retrieve and restore the user's Facebook login credentials from the app's shared preferences.

Parameters:
facebook - - an instantiated facebook object
Returns:
a boolean indicating if the stored login credentials are valid