Facebook布局错误无法解析资源值:0x7F08000A

时间:2013-06-10 10:16:28

标签: android android-facebook

我在我的应用程序中有登录facebook按钮和发布按钮,当我使用它时,它工作正常,但当我去布局时,我发现这个错误,我不知道什么意思...

我需要一个线索知道如何继续

来自布局的错误

Exception raised during rendering: Could not resolve resource value: 0x7F08000A.
Exception details are logged in Window > Show View > Error Log
The following classes could not be instantiated:
- com.facebook.widget.LoginButton (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse

android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F070004.
    at android.content.res.BridgeResources.throwException(BridgeResources.java:693)
    at android.content.res.BridgeResources.getColor(BridgeResources.java:185)
    at com.facebook.widget.LoginButton.<init>(LoginButton.java:204)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(    at sun.reflect.NativeConstructorAccessorImpl.newInstance(    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(    at java.lang.reflect.Constructor.newInstance(    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:422)
    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:179)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:746)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:718)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:749)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:718)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:372)

我在java代码中使用facebook例子

   public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        Intent intent= getIntent();
        video_id = intent.getStringExtra("video_id");
        video_id =  "http://www.youtube.com/watch?v="+video_id ;

        uiHelper = new UiLifecycleHelper(this, callback);
        uiHelper.onCreate(savedInstanceState);

        if (savedInstanceState != null) {
            String name = savedInstanceState.getString(PENDING_ACTION_BUNDLE_KEY);
            pendingAction = PendingAction.valueOf(name);
        }

        setContentView(R.layout.facbook_login);

        loginButton = (LoginButton) findViewById(R.id.login_button);
        loginButton.setUserInfoChangedCallback(new LoginButton.UserInfoChangedCallback() {
            @Override
            public void onUserInfoFetched(GraphUser user) {
                HelloFacebookSampleActivity.this.user = user;
                updateUI();
                // It's possible that we were waiting for this.user to be populated in order to post a
                // status update.
                handlePendingAction();
            }
        });

        profilePictureView = (ProfilePictureView) findViewById(R.id.profilePicture);
        greeting = (TextView) findViewById(R.id.greeting);

        postStatusUpdateButton = (Button) findViewById(R.id.postStatusUpdateButton);
        postStatusUpdateButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                onClickPostStatusUpdate();
            }
        });

        exit_facebook = (Button) findViewById(R.id.exit_facebook);
        exit_facebook.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                finish();
            }
        });




    } 

更新:我在R

中找到了这个

public static final int com_facebook_loginview_text_color = 0x7f070004;

我尝试添加此图片com_facebook_loginview_text_color但是没有工作

1 个答案:

答案 0 :(得分:9)

尝试在Eclipse中重新启动Eclipse和/或刷新文件夹。