调用方法并将参数传递给活动中的片段时发生NullPointerException

时间:2017-04-17 10:16:31

标签: android

我需要从片段调用方法,并将字符串值作为参数传递。但是我得到NullPointerException并且它显示currenttodat是静态内容。在互联网上我只有如何从片段调用方法。但是我需要传递一个参数和它。虽然传递参数我得到了nullpointer异常。

 Calendar calendar = Calendar.getInstance();
    calendar.add(Calendar.DAY_OF_YEAR, count);
    currenttoday = dateFormat.format((calendar.getTime()));
    tv_date.setText(currenttoday);
    Toast.makeText(LandingActivity.this, currenttoday, Toast.LENGTH_SHORT).show();

    ManageCustomersFragment manageCustomersFragment = (ManageCustomersFragment) getSupportFragmentManager().findFragmentByTag("managecustomerTag");

    manageCustomersFragment.getApplicationList(currenttoday);

0 个答案:

没有答案