Android: Date Picker Dialog Fragment: A lot of calls for Garbage Collection -


This is my small program to test date picker communication.

MainActivity.java

Public Class Main Activity FragmentActivity tool extends OnClickListener {button bSelectDate; @ Override Protected Zero (Bundle Saved Instantstate) {Super. NET (Saved Instantstate); SetContentView (R.layout.activity_main); BSelectDate = (button) FindById (R.id.bSelectDate); BSelectDate.setOnClickListener (this); } @ Override Public Wide OnClick Onclick (see V) {// Tudo Auto-Generated Method Stub DateDocumentation Date = New DateDialogFragment (); Date.setCallBack (onDate); Date.show (getSupportFragmentManager), "date picker"); } OnDateSetListener onDate = new OnDateSetListener () {@Override public void Prdetset (Tithikar Show, Int year Mahineopriyr Int, Int Deofmonth) {Calendar cal = Calendar.getInstance (); Cal.set (calendar.YEAR, year); Cal.set (calendar. MONTH, monthoffier); Cal.set (Calendar. DAY_OF_MONTH, at the end of the day); Toast. Maketext (menactivity.es, "" + string.valouf (cal. Gatetime inmialies ()), toast.lnnhH_LOG). Show (); }};

}

Dinankdiylogfragmentkjawa

  public class Dinankdiolgfragment Daylogfragment (calendar Cal; OnDateSetListener onDateSet; private Int year, month, day ; public void set callback (OnDateSetListener onDateSet) {this.onDateSet = onDateSet;} @ override public dialogue on Crete Dialig (saved bundled Instensstet) {// Todo Auto-generated method stub calendar calories = Kailenderkjast Instens ( ); Year = cal.get (Calendar.YEAR); month = c al.get (Calendar.MONTH); day = cal.get (Calendar.DAY_OF_MONTH); new Date Picture dialog Return (getActivity (), onDateSet, year, month, day);}  

}

} program has pressed the buttons works correctly, but the problem is that, LogCat refuse reports of several calls for collecting such GC_CONCURRENT free, Jisifaeloelsi free, Jiarif up 201. etc. It worries me, whether in this way I am going to waste the trash with this small program I can reduce the number of acquisition.

This is not an error, but there is information that the garbage collector has gone.

If you are seeing a lot of people, it can mean that you are allocating many or have very little memory. You should try to improve your program's memory performance.

There is a good source information about checking the consumption of RAM in Android:

There is also a document about its memory consumption in Android general strategies:

very useful tool in the Android DDMS, which is part of the Android Development tools in Eclipse, to manage which you can use for profiling and memory allocation Are there. Tracking

Screenshots given below Some of these devices (all under DDS) have been highlighted, some devices should be activated by clicking the corresponding button in the left panel (highlighted in red ) And then you can see the values ​​(some with graph) by selecting the tab in the right tab which you want to see (highlighted in Blue)

Heap and Alloton Tracker in your case a lot Will be useful.

Enter image details here


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -