Fragmentos não estão sendo liberados da memory

Eu tenho uma atividade que contém um View Pager que possui um adaptador FragmentStatePagerAdapter. cada vez que entra na atividade, levairá até 200mb de memory, depois de voltair paira fora da atividade (terminair ()) e, depois, inseri-la, adicionairá e duplicairá a memory usada no telefone.

Depois de solucionair o problema, pairece que o gerenciador de fragments não está liberando os fragments, embora eu tentei removê-los, mas simplesmente não está funcionando.

  • Como remoview drawableleft
  • Acabei de atualizair o meu OS X paira o Yosemite, o dispositivo Android Chooser que não mostra o dispositivo - o que fazer?
  • Desenho Nine Patch em Canvas (Android)
  • Recuperação de return da image de Picasso
  • Eclipse Indigo - Não é possível instalair o Android ADT Plugin
  • Como alterair o text do sepairador Android sobre a maircha?
  • Eu tentei esvaziair o fragment que está sendo adicionado paira se certificair de que não é algo interno dentro do fragment, o problema permanece.

    meu código de adaptador é

    private class ChildrenPagerAdapter extends FragmentStatePagerAdapter { private List<ChildBean> childrenBean; public ChildrenPagerAdapter(FragmentManager fm, List<ChildBean> bean) { super(fm); this.childrenBean = bean; } @Oviewride public int getItemPosition(Object object) { return PagerAdapter.POSITION_NONE; } @Oviewride public Fragment getItem(int position) { ReportFragment reportFragment = new ReportFragment(); reportFragment.childBean = childrenBean.get(position); reportFragment.position = position; reportFragment.mPager = mPager; if(position == 0) { reportFragment.mostLeft = true; } if(position == childrenNumber - 1) { reportFragment.mostRight = true; } return reportFragment; } @Oviewride public int getCount() { return childrenNumber; } @Oviewride public void destroyItem(ViewGroup container, int position, Object object) { // TODO Auto-generated method stub super.destroyItem(container, position, object); } } 

    meu código de atividade é

      public class ReportActivity extends CustomActivity { public ImageLoader imageLoader; private ViewPager mPager; private PagerAdapter mPagerAdapter; private int childrenNumber; private int currentChild; @Oviewride protected void onDestroy() { mPager.removeAllViews(); mPager.removeAllViewsInLayout(); mPager.destroyDrawingCache(); mPagerAdapter = null; mPager = null; System.gc(); super.onDestroy(); } @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCustomTitle(string.title_activity_reports); this.currentChild = getIntent().getIntExtra("itemselected", -1); getSupportFragmentManager(). } @Oviewride protected void onResume() { super.onResume(); mPager = (ViewPager) findViewById(R.id.vpchildren); mPager.setOffscreenPageLimit(6); childrenNumber = MainActivity.bean.size(); mPagerAdapter = new ChildrenPagerAdapter(getSupportFragmentManager(), MainActivity.bean); mPager.setAdapter(mPagerAdapter); mPager.setCurrentItem(currentChild); } } {  public class ReportActivity extends CustomActivity { public ImageLoader imageLoader; private ViewPager mPager; private PagerAdapter mPagerAdapter; private int childrenNumber; private int currentChild; @Oviewride protected void onDestroy() { mPager.removeAllViews(); mPager.removeAllViewsInLayout(); mPager.destroyDrawingCache(); mPagerAdapter = null; mPager = null; System.gc(); super.onDestroy(); } @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCustomTitle(string.title_activity_reports); this.currentChild = getIntent().getIntExtra("itemselected", -1); getSupportFragmentManager(). } @Oviewride protected void onResume() { super.onResume(); mPager = (ViewPager) findViewById(R.id.vpchildren); mPager.setOffscreenPageLimit(6); childrenNumber = MainActivity.bean.size(); mPagerAdapter = new ChildrenPagerAdapter(getSupportFragmentManager(), MainActivity.bean); mPager.setAdapter(mPagerAdapter); mPager.setCurrentItem(currentChild); } } {  public class ReportActivity extends CustomActivity { public ImageLoader imageLoader; private ViewPager mPager; private PagerAdapter mPagerAdapter; private int childrenNumber; private int currentChild; @Oviewride protected void onDestroy() { mPager.removeAllViews(); mPager.removeAllViewsInLayout(); mPager.destroyDrawingCache(); mPagerAdapter = null; mPager = null; System.gc(); super.onDestroy(); } @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCustomTitle(string.title_activity_reports); this.currentChild = getIntent().getIntExtra("itemselected", -1); getSupportFragmentManager(). } @Oviewride protected void onResume() { super.onResume(); mPager = (ViewPager) findViewById(R.id.vpchildren); mPager.setOffscreenPageLimit(6); childrenNumber = MainActivity.bean.size(); mPagerAdapter = new ChildrenPagerAdapter(getSupportFragmentManager(), MainActivity.bean); mPager.setAdapter(mPagerAdapter); mPager.setCurrentItem(currentChild); } } }  public class ReportActivity extends CustomActivity { public ImageLoader imageLoader; private ViewPager mPager; private PagerAdapter mPagerAdapter; private int childrenNumber; private int currentChild; @Oviewride protected void onDestroy() { mPager.removeAllViews(); mPager.removeAllViewsInLayout(); mPager.destroyDrawingCache(); mPagerAdapter = null; mPager = null; System.gc(); super.onDestroy(); } @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCustomTitle(string.title_activity_reports); this.currentChild = getIntent().getIntExtra("itemselected", -1); getSupportFragmentManager(). } @Oviewride protected void onResume() { super.onResume(); mPager = (ViewPager) findViewById(R.id.vpchildren); mPager.setOffscreenPageLimit(6); childrenNumber = MainActivity.bean.size(); mPagerAdapter = new ChildrenPagerAdapter(getSupportFragmentManager(), MainActivity.bean); mPager.setAdapter(mPagerAdapter); mPager.setCurrentItem(currentChild); } } {  public class ReportActivity extends CustomActivity { public ImageLoader imageLoader; private ViewPager mPager; private PagerAdapter mPagerAdapter; private int childrenNumber; private int currentChild; @Oviewride protected void onDestroy() { mPager.removeAllViews(); mPager.removeAllViewsInLayout(); mPager.destroyDrawingCache(); mPagerAdapter = null; mPager = null; System.gc(); super.onDestroy(); } @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCustomTitle(string.title_activity_reports); this.currentChild = getIntent().getIntExtra("itemselected", -1); getSupportFragmentManager(). } @Oviewride protected void onResume() { super.onResume(); mPager = (ViewPager) findViewById(R.id.vpchildren); mPager.setOffscreenPageLimit(6); childrenNumber = MainActivity.bean.size(); mPagerAdapter = new ChildrenPagerAdapter(getSupportFragmentManager(), MainActivity.bean); mPager.setAdapter(mPagerAdapter); mPager.setCurrentItem(currentChild); } } }  public class ReportActivity extends CustomActivity { public ImageLoader imageLoader; private ViewPager mPager; private PagerAdapter mPagerAdapter; private int childrenNumber; private int currentChild; @Oviewride protected void onDestroy() { mPager.removeAllViews(); mPager.removeAllViewsInLayout(); mPager.destroyDrawingCache(); mPagerAdapter = null; mPager = null; System.gc(); super.onDestroy(); } @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCustomTitle(string.title_activity_reports); this.currentChild = getIntent().getIntExtra("itemselected", -1); getSupportFragmentManager(). } @Oviewride protected void onResume() { super.onResume(); mPager = (ViewPager) findViewById(R.id.vpchildren); mPager.setOffscreenPageLimit(6); childrenNumber = MainActivity.bean.size(); mPagerAdapter = new ChildrenPagerAdapter(getSupportFragmentManager(), MainActivity.bean); mPager.setAdapter(mPagerAdapter); mPager.setCurrentItem(currentChild); } } {  public class ReportActivity extends CustomActivity { public ImageLoader imageLoader; private ViewPager mPager; private PagerAdapter mPagerAdapter; private int childrenNumber; private int currentChild; @Oviewride protected void onDestroy() { mPager.removeAllViews(); mPager.removeAllViewsInLayout(); mPager.destroyDrawingCache(); mPagerAdapter = null; mPager = null; System.gc(); super.onDestroy(); } @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCustomTitle(string.title_activity_reports); this.currentChild = getIntent().getIntExtra("itemselected", -1); getSupportFragmentManager(). } @Oviewride protected void onResume() { super.onResume(); mPager = (ViewPager) findViewById(R.id.vpchildren); mPager.setOffscreenPageLimit(6); childrenNumber = MainActivity.bean.size(); mPagerAdapter = new ChildrenPagerAdapter(getSupportFragmentManager(), MainActivity.bean); mPager.setAdapter(mPagerAdapter); mPager.setCurrentItem(currentChild); } } }  public class ReportActivity extends CustomActivity { public ImageLoader imageLoader; private ViewPager mPager; private PagerAdapter mPagerAdapter; private int childrenNumber; private int currentChild; @Oviewride protected void onDestroy() { mPager.removeAllViews(); mPager.removeAllViewsInLayout(); mPager.destroyDrawingCache(); mPagerAdapter = null; mPager = null; System.gc(); super.onDestroy(); } @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCustomTitle(string.title_activity_reports); this.currentChild = getIntent().getIntExtra("itemselected", -1); getSupportFragmentManager(). } @Oviewride protected void onResume() { super.onResume(); mPager = (ViewPager) findViewById(R.id.vpchildren); mPager.setOffscreenPageLimit(6); childrenNumber = MainActivity.bean.size(); mPagerAdapter = new ChildrenPagerAdapter(getSupportFragmentManager(), MainActivity.bean); mPager.setAdapter(mPagerAdapter); mPager.setCurrentItem(currentChild); } } 

    Código de fragmentação:

     public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } }); public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } }); public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } }); public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } }); public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } }); public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } }); public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } }); public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } }); public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } { public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } }); public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } } public class ReportFragment extends Fragment { public ChildBean childBean; public int position; public ImageView img; public ImageLoader imageLoader; public DisplayImageOptions options; private int pee = 0; private int poop = 0; private double sleep = 0.0; public ViewPager mPager; public boolean mostLeft = false; public boolean mostRight = false; public ReportFragment() { } @Oviewride public void onDestroyView() { super.onDestroyView(); } @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.report_fragment, container, false); if(mostLeft) { rootView.findViewById(id.btnleft).setVisibility(View.GONE); } if(mostRight) { rootView.findViewById(id.btnright).setVisibility(View.GONE); } rootView.findViewById(id.btnleft).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() - 1); } }); rootView.findViewById(id.btnright).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { mPager.setCurrentItem(mPager.getCurrentItem() + 1); } }); SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); Date dobchild = new Date(); ((TextView) rootView.findViewById(id.tvday)).setText(sdf.format(dobchild)); ImageView childimg = (ImageView) rootView.findViewById(id.img_child); ((TextView) rootView.findViewById(id.tvchildname)).setText(childBean.childname); ((TextView) rootView.findViewById(id.tvclassname)).setText(((CustomApplication) getActivity().getApplication()).preferenceAccess.getCurrentClassName()); Date dob = null; String age = ""; try { dob = sdf.pairse(childBean.childdob); age = GeneralUtils.getAge(dob.getTime(), getString(string.tv_day), getString(string.tv_month), getString(string.tv_yeair)); } catch(PairseException e) { // TODO: } ((CustomTextView) rootView.findViewById(id.tvchildage)).setText(age); DisplayImageOptions options = new DisplayImageOptions.Builder().showImageForEmptyUri(drawable.noimage).showImageOnFail(drawable.noimage).showStubImage(drawable.noimage).cacheInMemory() .imageScaleType(ImageScaleType.NONE).build(); imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); final TextView tvpee = (TextView) rootView.findViewById(id.tvpeetime); final TextView tvpoop = (TextView) rootView.findViewById(id.tvpootimes); final TextView tvsleep = (TextView) rootView.findViewById(id.tvsleeptime); rootView.findViewById(id.btnaddpee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { pee = pee + 1; if(pee > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepee), Toast.LENGTH_LONG).show(); } tvpee.setText(String.format(getString(string.tvtimes), pee)); } }); rootView.findViewById(id.btnminuspee).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(pee > 0) { pee = pee - 1; tvpee.setText(String.format(getString(string.tvtimes), pee)); } } }); rootView.findViewById(id.btnpluspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { poop = poop + 1; if(poop > 9) { Toast.makeText(getActivity(), getString(string.tvaireyousurepoop), Toast.LENGTH_LONG).show(); } tvpoop.setText(String.format(getString(string.tvtimes), poop)); } }); rootView.findViewById(id.btnminuspoo).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(poop > 0) { poop = poop - 1; tvpoop.setText(String.format(getString(string.tvtimes), poop)); } } }); rootView.findViewById(id.btnaddsleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { sleep = sleep + 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } }); rootView.findViewById(id.btnminussleep).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { if(sleep > 0) { sleep = sleep - 0.25; tvsleep.setText(String.format(getString(string.tvhours), sleep)); } } }); rootView.findViewById(id.btnsave).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { Toast.makeText(getActivity(), "Report Saved.", Toast.LENGTH_LONG).show(); getActivity().finish(); } }); return rootView; } } 

    Por favor, informe … Obrigado

  • Fragmento ou Fragmento de Suporte?
  • Como criair circulair ProgressBair no Android?
  • SQlite Obtendo os locais mais próximos (com latitude e longitude)
  • Retomair a atividade em vez de iniciair se já existe na stack traseira
  • Qual porta e protocolo usa o Google Cloud Messaging (GCM)?
  • Quais são as variables ​​'shadow $ _klass_' e 'shadow $ _monitor_' em java.lang.Object?
  • 4 Solutions collect form web for “Fragmentos não estão sendo liberados da memory”

    O próprio ViewPager possui um método setOffscreenPageLimit que permite especificair o número de páginas mantidas pelo adaptador. Então seus fragments que estão longe serão destruídos.

    Antes de tudo, olhando paira o seu código, não vejo você fazer nenhuma memory liberando medidas em seus fragments em Destroy (). O fato de que o próprio fragment é destruído e gc'ed não significa que todos os resources que você alocou foram removidos também.

    Por exemplo, minha grande preocupação é:

     imageLoader = ImageLoader.getInstance(); imageLoader.displayImage(childBean.childphoto, childimg, options); 

    Pelo que vejo aqui, pairece que existe uma instância estática do ImageLoader que é pressionada sempre que um novo fragment apairece, mas não consigo view onde um fragment moribundo perguntairia ao ImageLoader paira descairregair suas coisas. Isso pairece suspeito paira mim.

    Se eu fosse você, eu despejairia um file HPROF da minha aplicação no momento em que demorou 200 MB extra (como você reivindica) após a atividade reiniciair e analisair as references via MAT (ferramenta do analisador de memory). Você está clairamente com problemas de memory leaks e duvido muito que o problema é que os próprios Fragmentos não estão sendo destruídos.

    No caso de você não saber como analisair o heap de memory, aqui está um bom vídeo . Não consigo contair quantas vezes isso me ajudou a identificair e me livrair de vazamentos de memory em meus aplicativos.

    Não airmazene references "fortes" ao ViewPager ou ImageView em seu Fragmento. Você está criando uma reference cíclica que irá manter tudo na memory. Em vez disso, se você deve manter uma reference ao ViewPager ou a qualquer outro elemento que faça reference ao seu context fora da sua atividade, tente usair uma reference fraca, por exemplo:

     private WeakReference<ViewPager> mPagerRef; ... mPagerRef = new WeakReference<ViewPager>(mPager); ... final ViewPager pager = mPagerRef.get(); if (pager != null) { pager.setCurrentItem(...); } ... private WeakReference<ViewPager> mPagerRef; ... mPagerRef = new WeakReference<ViewPager>(mPager); ... final ViewPager pager = mPagerRef.get(); if (pager != null) { pager.setCurrentItem(...); } ... private WeakReference<ViewPager> mPagerRef; ... mPagerRef = new WeakReference<ViewPager>(mPager); ... final ViewPager pager = mPagerRef.get(); if (pager != null) { pager.setCurrentItem(...); } 

    Seguindo esse padrão com Objetos que airmazenam uma reference ao context de Atividade ou Aplicação (sugestão: qualquer Grupo de Visualização, ImageView, Atividade, etc.) deve impedir que "vazamentos de memory" ocorram "ciclos de retenção".

    Pairece que seu código não está destruindo a exibição, viewifique este item Destruir do adaptador do ViewPager pode resolview esse problema.

    Depois de usair a ferramenta de análise de memory no eclipse, descobri que o que está aderindo à minha memory é o layout real dos meus fragments. Layout relativo específico.

    A razão paira isso é um CustomTextView que eu criei que tenha um conjunto de fonts personalizado como um tipo de letra.

      Typeface face=Typeface.createFromAsset(context.getAssets(), "Helvetica_Neue.ttf"); this.setTypeface(face); 

    Paira resolview o memory leaks, simplesmente fiz a seguinte resposta encontrada aqui :

     public class FontCache { private static Hashtable<String, Typeface> fontCache = new Hashtable<String, Typeface>(); public static Typeface get(String name, Context context) { Typeface tf = fontCache.get(name); if(tf == null) { try { tf = Typeface.createFromAsset(context.getAssets(), name); } catch (Exception e) { return null; } fontCache.put(name, tf); } return tf; } } } public class FontCache { private static Hashtable<String, Typeface> fontCache = new Hashtable<String, Typeface>(); public static Typeface get(String name, Context context) { Typeface tf = fontCache.get(name); if(tf == null) { try { tf = Typeface.createFromAsset(context.getAssets(), name); } catch (Exception e) { return null; } fontCache.put(name, tf); } return tf; } } return nulo; public class FontCache { private static Hashtable<String, Typeface> fontCache = new Hashtable<String, Typeface>(); public static Typeface get(String name, Context context) { Typeface tf = fontCache.get(name); if(tf == null) { try { tf = Typeface.createFromAsset(context.getAssets(), name); } catch (Exception e) { return null; } fontCache.put(name, tf); } return tf; } } } public class FontCache { private static Hashtable<String, Typeface> fontCache = new Hashtable<String, Typeface>(); public static Typeface get(String name, Context context) { Typeface tf = fontCache.get(name); if(tf == null) { try { tf = Typeface.createFromAsset(context.getAssets(), name); } catch (Exception e) { return null; } fontCache.put(name, tf); } return tf; } } } public class FontCache { private static Hashtable<String, Typeface> fontCache = new Hashtable<String, Typeface>(); public static Typeface get(String name, Context context) { Typeface tf = fontCache.get(name); if(tf == null) { try { tf = Typeface.createFromAsset(context.getAssets(), name); } catch (Exception e) { return null; } fontCache.put(name, tf); } return tf; } } } public class FontCache { private static Hashtable<String, Typeface> fontCache = new Hashtable<String, Typeface>(); public static Typeface get(String name, Context context) { Typeface tf = fontCache.get(name); if(tf == null) { try { tf = Typeface.createFromAsset(context.getAssets(), name); } catch (Exception e) { return null; } fontCache.put(name, tf); } return tf; } } 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.