-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?

4

1 回答 1

2

-每次按下按钮时,您都需要inflate此弹出式布局。

-你需要那个充气view.findViewById(......);

它将如下所示:

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);
于 2012-11-12T12:09:53.167 回答