當前位置: 首頁>>代碼示例>>Java>>正文


Java FacebookSdk.sdkInitialize方法代碼示例

本文整理匯總了Java中com.facebook.FacebookSdk.sdkInitialize方法的典型用法代碼示例。如果您正苦於以下問題:Java FacebookSdk.sdkInitialize方法的具體用法?Java FacebookSdk.sdkInitialize怎麽用?Java FacebookSdk.sdkInitialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.facebook.FacebookSdk的用法示例。


在下文中一共展示了FacebookSdk.sdkInitialize方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initFBSdk

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
private void initFBSdk() {
    if (!FacebookSdk.isInitialized()) {
        FacebookSdk.setApplicationId(ApiObjects.facebook.get("app_id"));
        FacebookSdk.sdkInitialize(getActivity().getApplicationContext());
    }
    callbackManager = CallbackManager.Factory.create();

    profileTracker = new ProfileTracker() {
        @Override
        protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) {
            if (eventHandler != null) {
                if (currentProfile != null)
                    eventHandler.onFacebookLoggedIn();
            }
        }
    };
}
 
開發者ID:Dnet3,項目名稱:CustomAndroidOneSheeld,代碼行數:18,代碼來源:FacebookShield.java

示例2: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
    public void onCreate() {
        super.onCreate();
        if (BuildConfig.CRASH_REPORTS) {
            Fabric.with(this, new Crashlytics());
        }

        INSTANCE = this;

//        if(LeakCanary.isInAnalyzerProcess(this))
//            return;
//        LeakCanary.install(this);
        FacebookSdk.sdkInitialize(getApplicationContext());

        AppEventsLogger.activateApp(this);
        UserToken.getInstance().initSharedPreferences(this);

    }
 
開發者ID:ukevgen,項目名稱:BizareChat,代碼行數:19,代碼來源:BizareChatApp.java

示例3: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FacebookSdk.sdkInitialize(getApplicationContext());
    callbackManager = CallbackManager.Factory.create();

    if(AppController.USER_ID != null && AppController.USER_TOKEN != null) {
        new CountDownTimer(1000, 100) {
            public void onTick(long millisUntilFinished) { }
            public void onFinish() {
                goActivityMain();
            }
        }.start();
    } else {
        changeToLoginView();
    }

    pref = getSharedPreferences(CONST.PREF_NAME, MODE_PRIVATE);
    editor = pref.edit();
}
 
開發者ID:lecrec,項目名稱:lecrec-android,代碼行數:21,代碼來源:ActivityLaunchScreen.java

示例4: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FacebookSdk.sdkInitialize(this.getApplicationContext());
    callbackManager = CallbackManager.Factory.create();
    shareDialog = new ShareDialog(this);
    shareDialog.registerCallback(
            callbackManager,
            shareCallback);

    // Can we present the share dialog for regular links?
    canPresentShareDialog = ShareDialog.canShow(
            ShareLinkContent.class);

    // Can we present the share dialog for photos?
    canPresentShareDialogWithPhotos = ShareDialog.canShow(
            SharePhotoContent.class);
}
 
開發者ID:JimRoid,項目名稱:EasyFacebook,代碼行數:19,代碼來源:BaseLoginActivity.java

示例5: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
    public void onCreate() {
        super.onCreate();

        mContext = getApplicationContext();
        mAppHelper = new AppHelper();

        FacebookSdk.sdkInitialize(getApplicationContext());

        initScreenSize();

        if (Config.IS_DEBUG_MODE) {
            mAppHelper.showKeyHash();
            mAppHelper.showSHA1Key();
        }

        CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
//                        .setDefaultFontPath("fonts/Roboto-RobotoRegular.ttf")
                .setFontAttrId(R.attr.fontPath)
                .build());
    }
 
開發者ID:kgeriiie,項目名稱:android-fagyi,代碼行數:22,代碼來源:App.java

示例6: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FacebookSdk.sdkInitialize(getActivity());
    loginManager = LoginManager.getInstance();
    callbackManager = CallbackManager.Factory.create();
    mActivity = getActivity();
    mContext = getActivity().getApplicationContext();
    //Google
    mGoogleApiClient = new GoogleApiClient.Builder(mContext)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Plus.API)
            .addScope(new Scope(Scopes.PROFILE))
            .build();
}
 
開發者ID:ITsvetkoFF,項目名稱:Kv-009,代碼行數:17,代碼來源:LoginFragment.java

示例7: init

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
public static void init() {
    FacebookConnect.implClass = FacebookImpl.class;
    permissions = new ArrayList<String>();
    String permissionsStr = Display.getInstance().getProperty("facebook_permissions", "");
    permissionsStr = permissionsStr.trim();

    StringTokenizer token = new StringTokenizer(permissionsStr, ", ");
    if (token.countTokens() > 0) {
        try {
            while (token.hasMoreElements()) {
                String permission = (String) token.nextToken();
                permission = permission.trim();
                permissions.add(permission);
            }
        } catch (Exception e) {
            //the pattern is not valid
        }

    }
    FacebookSdk.sdkInitialize(AndroidNativeUtil.getContext().getApplicationContext());

}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:23,代碼來源:FacebookImpl.java

示例8: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FacebookSdk.sdkInitialize(getApplicationContext());
    setContentView(R.layout.select_domain);
    TextView server = (TextView) findViewById(R.id.textView_server_url);
    url = getIntent().getStringExtra("server");
    server.setText(url);
    callbackManager = CallbackManager.Factory.create();

    findViewById(R.id.button_domain_google).setOnClickListener(this);
    ((SignInButton) findViewById(R.id.button_domain_google)).setSize(SignInButton.SIZE_WIDE);

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Plus.API)
            .addScope(new Scope(Scopes.PROFILE))
            .addScope(new Scope(Scopes.EMAIL))
            .build();
}
 
開發者ID:jokr,項目名稱:nfcoauth,代碼行數:22,代碼來源:SelectDomain.java

示例9: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
public void onCreate()
{
    super.onCreate();
    Parse.initialize(new Parse.Configuration.Builder(this).applicationId(getResources().getString(R.string.app_id)).clientKey(getResources().getString(R.string.client_key)).server("https://parseapi.back4app.com").build());

    ParseInstallation installation = ParseInstallation.getCurrentInstallation();
    installation.put("GCMSenderId", "644469506430");
    installation.saveInBackground();

    FacebookSdk.sdkInitialize(this);
    printHashkey();
    nitems.add(new NavigationItem(R.drawable.search, "Search"));
    nitems.add(new NavigationItem(R.drawable.recent,"Recent"));
    nitems.add(new NavigationItem(R.drawable.npost,"Post"));

    litems.add(new NavigationItem(R.drawable.myposts, "My Posts"));
    //litems.add(new NavigationItem(R.drawable.star,"My Bookmarks"));

}
 
開發者ID:karnikram,項目名稱:seglio,代碼行數:21,代碼來源:Biblio.java

示例10: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    Paper.init(this);

    CrashHandler.getInstance().init(this);
    ImageUtil.init(this);
    NetworkUtil.init(this);
    ConfigUtil.init(this);
    TextToast.init(this);

    //Facebook分享初始化
    FacebookSdk.sdkInitialize(getApplicationContext());
    //友盟意見反饋初始化
    FeedbackPush.getInstance(this).init(false);
}
 
開發者ID:Uphie,項目名稱:ONE-Unofficial,代碼行數:17,代碼來源:App.java

示例11: init

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
public void init() {
	// Initialize listener.
	// ...

	FacebookSdk.sdkInitialize(activity);
	// FacebookSdk.setApplicationId(activity.getString(R.string.facebook_app_id));

	mAuth = FirebaseAuth.getInstance();
	mAuthListener = new FirebaseAuth.AuthStateListener() {

		@Override
		public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
			FirebaseUser user = firebaseAuth.getCurrentUser();
			if (user != null) {
				for (UserInfo usr : user.getProviderData()) {
					if (usr.getProviderId().equals("facebook.com")) {
						Utils.d("FB:AuthStateChanged:signed_in:"+
						user.getUid());
						successLogin(user);
					}
				}
			} else {
				// User is signed out
				Utils.d("FB:onAuthStateChanged:signed_out");
				successLogOut();
			}

			// update user details;
		}
	};

	// AppEventsLogger.activityApp(activity);

	initCallbacks();
	onStart();

	Utils.d("Facebook auth initialized.");
}
 
開發者ID:FrogSquare,項目名稱:GodotFireBase,代碼行數:39,代碼來源:FacebookSignIn.java

示例12: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    generator();
    FacebookSdk.sdkInitialize(getApplicationContext());
    callbackManager = CallbackManager.Factory.create();
    AppEventsLogger.activateApp(this);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_main);
    LogSaver.appendLog(TAG);
    logoiv = (ImageView) findViewById(R.id.imageView);
    TextView tv2016= (TextView) findViewById(R.id.l2016);
    Typeface typeface1=Typeface.createFromAsset(getAssets(),"canaro_extra_bold.otf");
    tv2016.setTypeface(typeface1);
    Typeface typeface=Typeface.createFromAsset(getAssets(),"canaro_extra_bold.otf");
    ShimmerTextView textView = (ShimmerTextView) findViewById(R.id.shimmertv);
    KenBurnsView kenBurnsView= (KenBurnsView) findViewById(R.id.kbview);
    kenBurnsView.animate().setDuration(500).start();
    if (textView != null) {
        textView.setTypeface(typeface);
    }
    Shimmer shimmer = new Shimmer();
    shimmer.start(textView);
    nextActivity();

}
 
開發者ID:rishabh115,項目名稱:Odyssey2017,代碼行數:29,代碼來源:MainActivity.java

示例13: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_feeds);
    LogSaver.appendLog(TAG);
    cacher();

    progressBar=(ProgressBar) findViewById(R.id.feed_progress);
    toolbar= (Toolbar) findViewById(R.id.feed_toolbar);
    toolbar.setNavigationIcon(R.drawable.backbutton);
    FacebookSdk.sdkInitialize(getApplicationContext());
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });
    lvfeed= (ListView) findViewById(R.id.feed_list);
    ConnectionDetector ob=new ConnectionDetector(getApplicationContext());
  //  if (!ob.isConnecting())
  //  {
   //     Toast.makeText(getApplicationContext(),"Please connect to Internet",Toast.LENGTH_LONG).show();
  //  }
   // else{
    new Background().execute(FEED_URl);
//}
}
 
開發者ID:rishabh115,項目名稱:Odyssey2017,代碼行數:28,代碼來源:FeedActivity.java

示例14: onCreate

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
    }
    AppInjector.init(this);

    FacebookSdk.sdkInitialize(getApplicationContext());
    AppEventsLogger.activateApp(this);
}
 
開發者ID:hbmartin,項目名稱:firebase-chat-android-architecture-components,代碼行數:12,代碼來源:ChatApp.java

示例15: facebookGraphRequest

import com.facebook.FacebookSdk; //導入方法依賴的package包/類
public void facebookGraphRequest() {
    if (!FacebookSdk.isInitialized()) {
        FacebookSdk.sdkInitialize(getApplicationContext());
        AppEventsLogger.activateApp(getApplication());
    }
    GraphRequest request = GraphRequest.newMeRequest(
            //loginResult.getAccessToken(),
            AccessToken.getCurrentAccessToken(),
            new GraphRequest.GraphJSONObjectCallback() {
                @Override
                public void onCompleted(JSONObject object, GraphResponse response) {
                    Log.v(TAG, response.toString());

                    // Application code
                    try {
                        if (object == null) return;
                        Person person = new Person();
                        String name = object.getString("name");
                        String gender = object.getString("gender"); // 01/31/1980 format
                        String id = object.getString("id");
                        Log.d(TAG, "Name: " + name + ". Gender: " + gender);
                        person.setName(name);
                        person.setId(id);
                        person.setLink("http://www.facebook.com/" + id);

                        dataKey = mPlaceReference.push().getKey();
                        mPlaceReference.child(dataKey).setValue(person);


                    } catch (JSONException e) {
                        e.printStackTrace();

                    }
                }
            });
    Bundle parameters = new Bundle();
    parameters.putString("fields", "id,name,email,gender,birthday");
    request.setParameters(parameters);
    request.executeAsync();
}
 
開發者ID:Pavou,項目名稱:Stalker,代碼行數:41,代碼來源:PeopleListActivity.java


注:本文中的com.facebook.FacebookSdk.sdkInitialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。