Android活动有java.lang.IllegalArgumentException:View = com.android.internal.policy.impl.PhoneWindow $ DecorView异常并被崩溃

时间:2016-08-08 10:27:21

标签: android

当android活动开始时,它会出现以下错误。

  

java.lang.IllegalArgumentException异常:   查看= com.android.internal.policy.impl.PhoneWindow $ {DecorView 16055902   V.E ..... R ...... D 0,0-639,154}未附加到窗口管理器

enter image description here

这是我的.java文件 第1步:InviteFriendsActivity.java     public class InviteFriendsActivity extends AppCompatActivity实现了View.OnClickListener {

    @Bind(R.id.btn_invite)
    MonoserratRegularButton btnInvite;
    @Bind(R.id.ll_main)
    LinearLayout llMain;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);     
        setContentView(R.layout.activity_invite_friends);
        ButterKnife.bind(this);
        btnInvite.setOnClickListener(this);
    }
}

Step2:Login.java

private void loadUrl(boolean isTrue) {

    mApp = new InstagramApp(this, ApplicationData.CLIENT_ID,
            ApplicationData.CLIENT_SECRET, ApplicationData.CALLBACK_URL, isTrue);

    mApp.setListener(new InstagramApp.OAuthAuthenticationListener() {

        @Override
        public void onSuccess() {
            // tvSummary.setText("Connected as " + mApp.getUserName());
            // userInfoHashmap = mApp.
            mApp.fetchUserName(handler);
            Intent intent = new Intent(LoginActivity.this,InviteFriendsActivity.class);
            startActivity(intent);
            finish();
        }

        @Override
        public void onFail(String error) {
            Toast.makeText(LoginActivity.this, error, Toast.LENGTH_SHORT)
                    .show();
        }
    });
}

0 个答案:

没有答案