Arehexes
Well-Known Member
So I'm trying to figure out how to make a custom dialog pop up on a function call, yet my app crashes when I try to pop it up on the app.
[HIGH] public void eventpopUpDialog(BluetoothAdapter bluetooth){
//Sets up the layout for the popup box
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.bluetooth_popup_status);
//Make the variables for each UI element on the pop up box
TextView output = (TextView) findViewById(R.id.popupDialogTV);
final Button close = (Button) findViewById(R.id.closePopUp);
//testing to see what is crashing
output.setText("test");
//The Event to close the dialog
close.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
[/HIGH]
This is the code in question, I'm at a lost for why it's not working >_>.
[HIGH] public void eventpopUpDialog(BluetoothAdapter bluetooth){
//Sets up the layout for the popup box
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.bluetooth_popup_status);
//Make the variables for each UI element on the pop up box
TextView output = (TextView) findViewById(R.id.popupDialogTV);
final Button close = (Button) findViewById(R.id.closePopUp);
//testing to see what is crashing
output.setText("test");
//The Event to close the dialog
close.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
[/HIGH]
This is the code in question, I'm at a lost for why it's not working >_>.