|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.content.Context
android.content.ContextWrapper
android.view.ContextThemeWrapper
android.app.Activity
com.drismo.facebook.ShareOnFacebook
public class ShareOnFacebook
This activity uses the Android Facebook SDK to share a link to Facebook via a Facebook application.
To specify string to share, use putExtra("facebookMessage", "this is the message");
Nested Class Summary | |
---|---|
(package private) class |
ShareOnFacebook.LoginDialogListener
Listen to events from the Facebook.DialogListener , and give the user relevant feedback. |
private class |
ShareOnFacebook.UploadToFacebook
Upload the content to Facebook, and finish all Facebook dialogs when finished. |
(package private) class |
ShareOnFacebook.WallPostDialogListener
Listen to events from the Facebook.DialogListener , and give the user relevant feedback. |
Field Summary | |
---|---|
private static java.lang.String |
APP_ID
|
private static java.lang.String |
EXPIRES
|
private Facebook |
facebook
|
private static java.lang.String |
KEY
|
private java.lang.String |
messageToPost
|
private static java.lang.String[] |
PERMISSIONS
|
private boolean |
shareImage
|
private static java.lang.String |
TOKEN
|
Fields inherited from class android.app.Activity |
---|
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK |
Fields inherited from class android.content.Context |
---|
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_NOT_FOREGROUND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MODE_APPEND, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NOTIFICATION_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, TELEPHONY_SERVICE, UI_MODE_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE |
Constructor Summary | |
---|---|
ShareOnFacebook()
|
Method Summary | |
---|---|
void |
doNotShare(android.view.View button)
Nothing to be done. |
void |
loginAndPostToWall()
Log on to Facebook. |
protected void |
onCreate(android.os.Bundle savedInstanceState)
Lock the screen orientation, manage received trip data and prompt the user to share. |
void |
postToWall(java.lang.String message)
Post the trip summary to the Facebook wall. |
boolean |
restoreCredentials(Facebook facebook)
Get the user's current Facebook login information, from our application preferences. |
boolean |
saveCredentials(Facebook facebook)
Storing Facebook login data to our (hidden) application preferences. |
void |
share(android.view.View button)
Share the trip. |
private void |
showToast(java.lang.String message)
Post a short Toast . |
Methods inherited from class android.app.Activity |
---|
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, finish, finishActivity, finishActivityFromChild, finishFromChild, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getInstanceCount, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLocalClassName, getMenuInflater, getParent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, getWindow, getWindowManager, hasWindowFocus, isChild, isFinishing, isTaskRoot, managedQuery, moveTaskToBack, onActivityResult, onApplyThemeResource, onAttachedToWindow, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onDestroy, onDetachedFromWindow, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNewIntent, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareOptionsMenu, onPreparePanel, onRestart, onRestoreInstanceState, onResume, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, overridePendingTransition, registerForContextMenu, removeDialog, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setIntent, setPersistent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, showDialog, showDialog, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startIntentSender, startIntentSenderForResult, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu |
Methods inherited from class android.view.ContextThemeWrapper |
---|
attachBaseContext, getTheme, setTheme |
Methods inherited from class android.content.ContextWrapper |
---|
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalFilesDir, getFilesDir, getFileStreamPath, getMainLooper, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver |
Methods inherited from class android.content.Context |
---|
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String APP_ID
private static final java.lang.String[] PERMISSIONS
private static final java.lang.String TOKEN
private static final java.lang.String EXPIRES
private static final java.lang.String KEY
private Facebook facebook
private java.lang.String messageToPost
private boolean shareImage
Constructor Detail |
---|
public ShareOnFacebook()
Method Detail |
---|
public boolean saveCredentials(Facebook facebook)
facebook
- A Facebook object, from the facebook-android-sdk.
public boolean restoreCredentials(Facebook facebook)
facebook
- A Facebook object, from the facebook-android-sdk.
protected void onCreate(android.os.Bundle savedInstanceState)
onCreate
in class android.app.Activity
savedInstanceState
- Not beeing used, as onSaveInstanceState(Bundle)
is not implemented.public void doNotShare(android.view.View button)
button
- buttonpublic void share(android.view.View button)
button
- buttonpublic void loginAndPostToWall()
public void postToWall(java.lang.String message)
message
- The text summary of the trip.private void showToast(java.lang.String message)
Toast
.
message
- The message to show.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |