1

当我打开上下文菜单然后旋转屏幕时,我在整个程序中都遇到了这个错误。

03-19 16:09:25.627: E/InputQueue-JNI(11610): channel '41c6ffc0 AtchDlg:xxx.xxxxxxxx.xxx/xxx.xxxxxxxx.xxx.TyContextMenuActivity (client)' ~ Publisher closed input channel or an error occurred. events=0x8

我将代码简化为我能想到的最基本的形式,但仍然出现错误,所以我认为它在 android 代码中。

public class TyContextMenuActivity extends Activity {

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

        TextView textView = new TextView(this)
        {

            @Override
            protected void onCreateContextMenu(ContextMenu menu)
            {
                super.onCreateContextMenu(menu);
                menu.setHeaderTitle("Rotate Screen");
                menu.addSubMenu("90 degrees");
            }

        };
        textView.setText("hold me");
        textView.setGravity(Gravity.CENTER);
        textView.setTextSize(50);
        registerForContextMenu(textView);
        setContentView(textView);
    }
}

有人能告诉我如何消除这个错误吗?

4

0 回答 0