-1

I'm trying to update two layouts at a time from one single activity class, but its crashing.

Here is what I'm doing:

User can interact with one layout and as soon a s user presses a button a popup comes, this popup is defines via another layout. So I neeed to update the popup layout every time, but while using the findViewById(), it is giving null and I cant modify the view.

What shall I do for this?

abhi
  • 1,412
  • 19
  • 25

1 Answers1

2

- You will need to inflate this pop-up layout everytime you press the button.

- You will need that inflate view.findViewById(......);

It will be something like below:

lLay.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
final Dialog exitDialog = new Dialog(ResetActivity.this,R.style.CustomDialogTheme_new);

v = View.inflate(getApplicationContext(),R.layout.spinnerlikedialog, null);
exitDialog.setContentView(v);

tClosing = (TableRow) v.findViewById(R.id.tableRow_ClosingDateDialog);
Kumar Vivek Mitra
  • 33,294
  • 6
  • 48
  • 75