当前位置: 首页>>代码示例>>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;未经允许,请勿转载。