我有一个导航模式为NAVIGATION_MODE_LIST的操作栏。
Resources recursos = this.getResources();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
ArrayAdapter adaptador = new TipoPincelAdapter(this, R.layout.spinner_tipos_pinceles_layout, recursos.getStringArray(R.array.codigo_tipo_lapiz) );
actionBar.setListNavigationCallbacks(adaptador, this);
我完成了()活动。如果我在其他时间加载此活动,然后返回完成它,我看到我在MAT中有两个对操作栏的引用。
com.innovativeproject.firstletters.Lienzo1Activity @ 0xb5db4ec0 | 264 | 66.144 | 0,19%| - com.android.internal.widget.ActionBarView @ 0xb5d1bb58 |
600 | 21.416 | 0,06%| | - android.widget.Spinner @ 0xb5db3bd8 | 600 | 4.384 | 0,01%| | | - android.view.View [12] @ 0xb5d2c870
| 64 | 2.640 | 0,01%| | | - android.graphics.drawable.StateListDrawable @ 0xb5ce05e8 |
88 | 696 | 0,00%| | | - android.widget.AbsSpinner $ RecycleBin @ 0xb5ce08a8 |
16 | 168 | 0,00%| | | - android.view.InputEventConsistencyVerifier @ 0xb5ce0568 |
80 | 104 | 0,00%| | | - android.widget.LinearLayout $ LayoutParams @ 0xb5ce0b60 |
56 | 56 | 0,00%| | | - android.view.animation.Transformation @ 0xb5ce0810 |
24 | 24 | 0,00%| | | - android.graphics.Rect @ 0xb5ce0888 | 24 | 24 |
0,00%| | | - android.graphics.Rect @ 0xb5ce08e0
| 24 | 24 | 0,00%| | | - android.graphics.PointF @ 0xb5ce0860 |
16 | 16 | 0,00%| | | - android.view.ViewGroup $ 3 @ 0xb5ce0878 | 16 | 16 |
0,00%| | | - android.widget.AdapterView $ SelectionNotifier @ 0xb5ce5720 | 16 | 16 | 0,00%| | “ - 总计:11个条目|
| | | | - com.android.internal.widget.ActionBarView $ HomeView @ 0xb5db60e0 |
472 | 3.944 | 0,01%| | - com.android.internal.widget.ActionBarView $ HomeView @ 0xb5d10958 |
472 | 3.360 | 0,01%
如何释放操作栏以避免增加内存?
非常感谢。
答案 0 :(得分:0)
从源代码中,ActionBarView
有两个HomeView
private HomeView mHomeLayout;
private HomeView mExpandedHomeLayout;
HomeView
是一个内部类。这可能就是你所看到的,无论如何你不应该担心你的观点“增加内存”,一旦它认为合适,视图就会被android破坏。