I have two different layouts. One of them, which loads at the start of Activity, and the other, which loads after running some checks and creates a custom dialog. There is a button in the dialog box to call, atclick has a Toast message at this point in time, so I can confirm that the button is pressed. Unfortunately, I cannot get an answer when a button is pressed. I have been everywhere on the Internet and I cannot find what I am missing.
public class myactivity extends Activity{ Dialog accesspopup; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_myactivity); View inflatedView = getLayoutInflater().inflate(R.layout.dialoglayout, null); final Button cabtn = (Button)inflatedView.findViewById(R.id.cb); cabtn.setOnClickListener(cListener); } private OnClickListener cListener = new OnClickListener() { public void onClick(View v) {
source share