我是一名新的Android开发人员,但我有一个奇怪的问题。 当我在手机上启动我的应用程序时(我测试它 - galaxy s3 I9300)我有一个dalvik问题:
04-26 21:01:20.780: I/Process(8739): Sending signal. PID: 8739 SIG: 9
04-26 21:01:29.435: D/dalvikvm(9357): WAIT_FOR_CONCURRENT_GC blocked 0ms
04-26 21:01:29.555: D/dalvikvm(9357): GC_FOR_ALLOC freed 76K, 5% free 12275K/12867K, paused 15ms, total 15ms
04-26 21:01:29.555: I/dalvikvm-heap(9357): Grow heap (frag case) to 13.010MB for 570856-byte allocation
04-26 21:01:29.580: D/dalvikvm(9357): GC_CONCURRENT freed 1K, 5% free 12831K/13447K, paused 14ms+1ms, total 27ms
04-26 21:01:29.580: D/dalvikvm(9357): WAIT_FOR_CONCURRENT_GC blocked 13ms
04-26 21:01:29.595: D/dalvikvm(9357): GC_FOR_ALLOC freed 0K, 5% free 12831K/13447K, paused 14ms, total 14ms
04-26 21:01:29.600: I/dalvikvm-heap(9357): Grow heap (frag case) to 13.976MB for 1014464-byte allocation
04-26 21:01:29.630: D/dalvikvm(9357): GC_CONCURRENT freed 0K, 5% free 13822K/14471K, paused 15ms+1ms, total 32ms
04-26 21:01:29.630: D/dalvikvm(9357): WAIT_FOR_CONCURRENT_GC blocked 13ms
04-26 21:01:29.655: D/dalvikvm(9357): GC_FOR_ALLOC freed 557K, 9% free 13501K/14727K, paused 16ms, total 16ms
04-26 21:01:29.675: D/dalvikvm(9357): GC_CONCURRENT freed 3K, 6% free 13931K/14727K, paused 4ms+2ms, total 20ms
04-26 21:01:29.675: D/dalvikvm(9357): WAIT_FOR_CONCURRENT_GC blocked 7ms
04-26 21:01:29.690: D/dalvikvm(9357): GC_FOR_ALLOC freed 234K, 8% free 13931K/14983K, paused 12ms, total 12ms
04-26 21:01:29.695: I/dalvikvm-heap(9357): Grow heap (frag case) to 14.489MB for 425616-byte allocation
04-26 21:01:29.710: D/dalvikvm(9357): GC_FOR_ALLOC freed <1K, 8% free 14346K/15431K, paused 14ms, total 14ms
04-26 21:01:29.735: D/dalvikvm(9357): GC_FOR_ALLOC freed 234K, 7% free 14358K/15431K, paused 17ms, total 17ms
04-26 21:01:29.735: I/dalvikvm-heap(9357): Grow heap (frag case) to 14.906MB for 425616-byte allocation
04-26 21:01:29.755: D/dalvikvm(9357): GC_FOR_ALLOC freed <1K, 7% free 14773K/15879K, paused 16ms, total 16ms
04-26 21:01:29.815: D/libEGL(9357): loaded /system/lib/egl/libEGL_mali.so
04-26 21:01:29.820: D/libEGL(9357): loaded /system/lib/egl/libGLESv1_CM_mali.so
04-26 21:01:29.830: D/libEGL(9357): loaded /system/lib/egl/libGLESv2_mali.so
04-26 21:01:29.835: D/(9357): Device driver API match
04-26 21:01:29.835: D/(9357): Device driver API version: 10
04-26 21:01:29.835: D/(9357): User space API version: 10
04-26 21:01:29.835: D/(9357): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Tue Oct 16 15:37:13 KST 2012
04-26 21:01:29.880: D/OpenGLRenderer(9357): Enabling debug mode 0
目前,我的应用只是绘制了一些观点:
public class Initialization extends Activity{
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate();
this.setContentView(R.layout.initialization);
}
}
我的R.layout.initialization:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.6"
android:background="@android:color/transparent"
android:onClick="contact_us"
android:orientation="horizontal" >
<ImageView
android:id="@+id/logo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@android:color/transparent"
android:contentDescription="@string/logo"
android:src="@drawable/logo_cut2" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0" >
<ImageView
android:id="@+id/sep_image_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/logo"
android:scaleType="fitXY"
android:src="@drawable/separation1" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3.3"
android:background="@android:color/transparent"
android:onClick="commander_fleurs" >
<RelativeLayout
android:id="@+id/relativeTextLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/text_creation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:text="@string/commander"
android:textColor="@android:color/white"
android:textSize="20sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignBottom="@+id/text_creation"
android:background="#ffffff" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/relativeImageLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/relativeTextLayout1" >
<com.mynamepackage.myapp.util.SquareLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@drawable/rounder_corners"
android:gravity="center" >
<ImageView
android:id="@+id/creation_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/logo"
android:onClick="commander_fleurs"
android:scaleType="fitXY" />
</com.mynamepackage.myapp.util.SquareLayout>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0" >
<ImageView
android:id="@+id/sep_image_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/logo"
android:scaleType="fitXY"
android:src="@drawable/separation3" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3.3"
android:background="@android:color/transparent"
android:baselineAligned="false"
android:onClick="info_pratique" >
<RelativeLayout
android:id="@+id/relativeTextLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/text_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:layout_marginRight="15dp"
android:background="@android:color/transparent"
android:text="@string/info"
android:textColor="@android:color/white"
android:textSize="20sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignBottom="@+id/text_info"
android:background="#ffffff" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/relativeTextLayout2" >
<com.mynamepackage.myapp.util.SquareLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:gravity="center" >
<ImageView
android:id="@+id/info_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/logo"
android:scaleType="fitXY" />
</com.mynamepackage.myapp.util.SquareLayout>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0" >
<ImageView
android:id="@+id/sep_image_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/logo"
android:scaleType="fitXY"
android:src="@drawable/separation2" />
</LinearLayout>
</LinearLayout>
也许如果能有所帮助,我的com.mynamepackage.myapp.util.SquareLayout(我用它来制作方形布局(宽度=高度)
public class SquareLayout extends LinearLayout {
public SquareLayout(Context context) {
super(context);
}
public SquareLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(heightMeasureSpec, heightMeasureSpec);
}
}
我的一些ImageView没有“src”,暂时是正常的(无论是否有“src”,问题都是一样的)。 我的图片(logo_cut2 / separation1 / ...)采用png格式,每个文件的重量不超过10ko。
SomeOne知道为什么我有这个问题? 你的时间周期:D