0

我的应用程序中有登录 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 中找到了这个

公共静态最终 int com_facebook_loginview_text_color = 0x7f070004;

我尝试添加此图片 com_facebook_loginview_text_color 但无法正常工作

4

1 回答 1

9

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

于 2013-06-10T10:56:20.637 回答