I have a popup implemented inside an Activity,and i'm trying to add onclicklistener to it,but it shows an error "Trying to invoke virtual method on a null object reference",but i checked the id of the edittext,which is "date_from" in popupdashboard.xml,am i missing something,do i need to add a reference for popdashboard.xml somewhere ??
public class DashboardActivity2 extends AppCompatActivity implements View.OnClickListener {
ImageView image;
EditText datefrom,dateto;
TextView amo_today,amo_yest,increase,percent;
private PopupWindow active;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard2);
datefrom = (EditText)findViewById(R.id.date_from);
datefrom.setOnClickListener(this);
dateto = (EditText)findViewById(R.id.date_to);
dateto.setOnClickListener(this);
any help would be appreciated