I get this error whenever I try to start my window class. I am using separate class, and not just a method within my game class, cause I need to disable back button on that popup window. I am calling this class with a button. This code works fine if I use it within my game class, but not in separate class. Here is my code:
public class Popup_pogresno extends Activity implements OnClickListener{
private PopupWindow pwindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
LayoutInflater layoutInflater
= (LayoutInflater)Popup_pogresno.this
.getSystemService(LAYOUT_INFLATER_SERVICE);
View popupView = layoutInflater.inflate(R.layout.popup, null);
pwindow = new PopupWindow(popupView, 300, 170, true);
Button btnDismiss = (Button)popupView.findViewById(R.id.bPopupOK);
btnDismiss.setOnClickListener(new Button.OnClickListener(){
public void onClick(View v) {
// TODO Auto-generated method stub
pwindow.dismiss();
}});
pwindow.showAtLocation(popupView, Gravity.CENTER, 0, 0);
}
public void onClick(View v) {
// TODO Auto-generated method stub
}
@Override
public void onBackPressed() {
}
}