Android black-screen & crash after starting an intent

vexorg

New Member
i have a little problem with the app im trying to develop.It's just a little camera-app.That's what i want to do:...take a picture and save it. Start another activity, load the picture in a pictureview (therfore i save the pictures path, so i could load/create a bmp by using BitmapFactory.decodeFile(picutrepath))...But that doesn't work.The screen turns black, and it is not even loading the xml.I always get a System.out saying "not a drm file opening notmally" but i don't know wether it is related to my try of loading the picture via BitmapFactory.I used Log.i to see if something is wrong with the path im using, but everything is fine.So i decided to try if i could load a simple .png-image from my R.drawables,but that doesn't work as well.The curious thing is that after the screen turns black the app just quits/exits without errors.Hope someone can help me, thanks :)Here's the code:How i start my second activity:\[code\]...takepictureButton = (ImageButton) findViewById(R.id.cameralayout_takepictureButton); takepictureButton.setOnClickListener(new ImageButton.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub camera.takePicture(shutterCallback, rawCallback, jpgCallback); try { Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } Log.i("", "Starting INTENT"); intentstart(); } });...private void intentstart() { // TODO Auto-generated method stub Intent intent = new Intent(this, FacebarActivity.class); startActivity(intent); }...\[/code\]Activity that i want to start:\[code\]public class FacebarActivity extends Activity { private ImageView imageview; private ImageButton cButton, xButton; private Bitmap picture; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pictureview); ImageView imageview = (ImageView) findViewById(R.id.pictureviewLayout_pictureView); picture = BitmapFactory.decodeResource(getResources(), R.drawable.buttonplay); imageview.setImageBitmap(picture); cButton = (ImageButton) findViewById(R.id.pictureviewLayout_CButton); cButton.setOnClickListener(new ImageButton.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub } }); XButton = (ImageButton) findViewById(R.id.pictureviewLayout_XButton); XButton.setOnClickListener(new ImageButton.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub } }); startthis();}\[/code\]And the pictureview.xml that i load with setContentView() :\[code\]<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical"tools:context=".CameraActivity" ><RelativeLayout android:id="@+id/pictureviewLayout_topbarlinearlayout" android:layout_width="fill_parent" android:layout_height="75dp" android:layout_alignParentTop="true" android:background="@drawable/topbar" ></RelativeLayout><ImageView android:id="@+id/pictureviewLayout_pictureView" android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_above="@+id/pictureviewLayout_bottombarlinearlayout" android:layout_below="@+id/pictureviewLayout_topbarlinearlayout" /><RelativeLayout android:id="@+id/pictureviewLayout_bottombarlinearlayout" android:layout_width="fill_parent" android:layout_height="75dp" android:layout_alignParentBottom="true" android:background="@drawable/bottombar" > <ImageButton android:id="@+id/pictureviewLayout_CButton" android:layout_width="150dp" android:layout_height="wrap_content" android:layout_alignTop="@+id/pictureviewLayout_XButton" android:layout_centerHorizontal="true" android:background="@android:color/transparent" android:src="http://stackoverflow.com/questions/14487829/@android:drawable/ic_menu_camera" /> <ImageButton android:id="@+id/pictureviewLayout_XButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginRight="24dp" android:layout_toLeftOf="@+id/pictureviewLayout_CButton" android:background="@android:color/transparent" android:src="http://stackoverflow.com/questions/14487829/@android:drawable/ic_notification_clear_all" /></RelativeLayout>\[/code\]And the logcat:\[code\]01-23 20:47:00.995: D/dalvikvm(7776): GC_FOR_ALLOC freed 69K, 6% free 12160K/12931K, paused 18ms, total 19ms01-23 20:47:00.995: I/dalvikvm-heap(7776): Grow heap (frag case) to 12.841MB for 432016-byte allocation01-23 20:47:01.020: D/dalvikvm(7776): GC_CONCURRENT freed <1K, 6% free 12581K/13383K, paused 12ms+1ms, total 25ms01-23 20:47:01.055: D/dalvikvm(7776): GC_FOR_ALLOC freed 0K, 6% free 12581K/13383K, paused 18ms, total 18ms01-23 20:47:01.055: I/dalvikvm-heap(7776): Grow heap (frag case) to 13.573MB for 768016-byte allocation01-23 20:47:01.085: D/dalvikvm(7776): GC_CONCURRENT freed 0K, 6% free 13331K/14151K, paused 12ms+2ms, total 27ms01-23 20:47:01.085: D/dalvikvm(7776): WAIT_FOR_CONCURRENT_GC blocked 11ms01-23 20:47:01.105: D/dalvikvm(7776): GC_FOR_ALLOC freed 424K, 9% free 12913K/14151K, paused 14ms, total 14ms01-23 20:47:01.120: D/dalvikvm(7776): GC_CONCURRENT freed <1K, 6% free 13335K/14151K, paused 2ms+1ms, total 18ms01-23 20:47:01.120: D/dalvikvm(7776): WAIT_FOR_CONCURRENT_GC blocked 2ms01-23 20:47:01.140: D/dalvikvm(7776): GC_FOR_ALLOC freed 0K, 6% free 13335K/14151K, paused 20ms, total 20ms01-23 20:47:01.145: I/dalvikvm-heap(7776): Grow heap (frag case) to 14.309MB for 768016-byte allocation01-23 20:47:01.160: D/dalvikvm(7776): GC_CONCURRENT freed 0K, 6% free 14085K/14919K, paused 3ms+1ms, total 19ms01-23 20:47:01.330: D/libEGL(7776): loaded /system/lib/egl/libEGL_mali.so01-23 20:47:01.355: D/libEGL(7776): loaded /system/lib/egl/libGLESv1_CM_mali.so01-23 20:47:01.355: D/libEGL(7776): loaded /system/lib/egl/libGLESv2_mali.so01-23 20:47:01.380: D/(7776): Device driver API match01-23 20:47:01.380: D/(7776): Device driver API version: 1001-23 20:47:01.380: D/(7776): User space API version: 10 01-23 20:47:01.380: D/(7776): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Tue Oct 16 15:37:13 KST 2012 01-23 20:47:01.440: D/OpenGLRenderer(7776): Enabling debug mode 001-23 20:47:02.040: I/Choreographer(7776): Skipped 46 frames! The application may be doing too much work on its main thread.01-23 20:47:09.230: I/APPLICATION(7776): STARTIng INTENT01-23 20:47:09.235: I/Kurz bevor(7776): null01-23 20:47:09.290: I/APPLICATION(7776): STARTED INTENT01-23 20:47:09.290: I/Choreographer(7776): Skipped 308 frames! The application may be doing too much work on its main thread.01-23 20:47:09.605: D/dalvikvm(7776): GC_CONCURRENT freed 836K, 10% free 13905K/15367K, paused 1ms+2ms, total 12ms01-23 20:47:09.605: D/dalvikvm(7776): WAIT_FOR_CONCURRENT_GC blocked 4ms\[/code\]
 
Back
Top