我正在创建popupwindow
如下,
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
super.onBackPressed();
LinearLayout linearLayout = new LinearLayout(TimerGameActivity.this);
TextView textView = new TextView(TimerGameActivity.this);
textView.setText("Quit? Score will be lost....");
linearLayout.addView(textView);
PopupWindow popupWindow = new PopupWindow(linearLayout, 200, 100,true);
popupWindow.showAtLocation(linearLayout, Gravity.BOTTOM, 10, 10)
}
但我面临以下问题。当我按下后退按钮时,它不允许我显示弹出窗口并破坏活动,它给了我以下错误:
04-18 15:04:55.457: E/WindowManager(590): Activity has leaked window android.widget.LinearLayout@44f88be8 that was originally added here
帮帮我。谢谢