创建CallbackManager.Factory.create()的实例;

时间:2017-08-09 09:50:37

标签: android

当我写这段代码为什么mFacebookCallbackManager的颜色变为红色说无法解析符号mFacebookCallbackManager

public class signin extends AppCompatActivity  {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    FacebookSdk.sdkInitialize(getApplicationContext());
    mFacebookCallbackManager = CallbackManager.Factory.create();


    setContentView(R.layout.activity_signin);

 }

 }

清单文件

 <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
 </application>

</manifest>

请帮助我解决问题

1 个答案:

答案 0 :(得分:0)

您没有声明变量mFacebookCallbackManager