android studio中的Facebook SDK按钮

android studio中的Facebook SDK按钮,android,facebook,facebook-graph-api,Android,Facebook,Facebook Graph Api,除了我的自定义登录之外,我正在尝试将facebook登录添加到我的应用程序中 我添加了FacebookSDK作为一个模块,但是当我尝试添加FacebookConnect按钮时,我得到了一个错误 Error: Rendering Problems The following classes could not be instantiated: - com.facebook.widget.LoginButton (Open Class, Show Exception) Tip: Use View

除了我的自定义登录之外,我正在尝试将facebook登录添加到我的应用程序中

我添加了FacebookSDK作为一个模块,但是当我尝试添加FacebookConnect按钮时,我得到了一个错误

Error:
 Rendering Problems The following classes could not be instantiated:
- com.facebook.widget.LoginButton (Open Class, Show Exception)
 Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE  Exception Details android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F040001.
代码:


首先可能是Eclipse的问题,您只需要重新设置环境。看看能不能帮上忙

其次,尝试使用此代码段来解决问题

if (isInEditMode())
{
    //do something else, as getResources() is not valid.
} else {
    //you can use getResources()
    String mystring = getResources().getString(R.string.mystring);
}

我正在使用Android Studio,如何重置环境@奥列格·戈尔迪丘克
if (isInEditMode())
{
    //do something else, as getResources() is not valid.
} else {
    //you can use getResources()
    String mystring = getResources().getString(R.string.mystring);
}