Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8571219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:44:09+00:00 2026-06-11T18:44:09+00:00

I am new to android programming and i was trying to make an app

  • 0

I am new to android programming and i was trying to make an app for managing my daily tasks. now my application needs to switch between activities, it starts normally on the first activity, but when i click the button to go to the other activity the app just crashes. i am debugging directly to my phone (Galaxy s3).

I thought the logcat output might be useful as i noticed it helped a lot during the other questions.

09-24 05:49:14.807: D/dalvikvm(9062): GC_FOR_ALLOC freed 137K, 4% free 12835K/13255K, paused 25ms
09-24 05:49:14.807: I/dalvikvm-heap(9062): Grow heap (frag case) to 13.065MB for 379472-byte allocation
09-24 05:49:14.837: D/dalvikvm(9062): GC_FOR_ALLOC freed <1K, 4% free 13205K/13639K, paused 11ms
09-24 05:49:14.862: D/AbsListView(9062): Get MotionRecognitionManager
09-24 05:49:16.102: D/CLIPBOARD(9062): Hide Clipboard dialog at Starting input: finished by someone else... !
09-24 05:49:22.282: D/AndroidRuntime(9062): Shutting down VM
09-24 05:49:22.282: W/dalvikvm(9062): threadid=1: thread exiting with uncaught exception (group=0x40c661f8)
09-24 05:49:22.297: E/AndroidRuntime(9062): FATAL EXCEPTION: main
09-24 05:49:22.297: E/AndroidRuntime(9062): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dailyplanner/com.example.dailyplanner.new_task}: java.lang.RuntimeException: Binary XML file line #24: You must supply a layout_width attribute.
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.app.ActivityThread.access$600(ActivityThread.java:128)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.os.Looper.loop(Looper.java:137)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.app.ActivityThread.main(ActivityThread.java:4514)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at java.lang.reflect.Method.invokeNative(Native Method)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at java.lang.reflect.Method.invoke(Method.java:511)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at dalvik.system.NativeStart.main(Native Method)
09-24 05:49:22.297: E/AndroidRuntime(9062): Caused by: java.lang.RuntimeException: Binary XML file line #24: You must supply a layout_width attribute.
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5331)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:5452)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.widget.RelativeLayout$LayoutParams.<init>(RelativeLayout.java:1064)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:933)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:69)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:741)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:280)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.app.Activity.setContentView(Activity.java:1892)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at com.example.dailyplanner.new_task.onCreate(new_task.java:23)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.app.Activity.performCreate(Activity.java:4562)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
09-24 05:49:22.297: E/AndroidRuntime(9062):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
09-24 05:49:22.297: E/AndroidRuntime(9062):     ... 11 more
09-24 05:49:22.317: D/dalvikvm(9062): GC_CONCURRENT freed 164K, 3% free 13459K/13831K, paused 1ms+2ms
09-24 05:49:22.322: E/SQLiteDatabase(9062): close() was never explicitly called on database '/data/data/com.example.dailyplanner/databases/MyDB' 
09-24 05:49:22.322: E/SQLiteDatabase(9062): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:2064)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1118)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1075)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1051)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1154)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1147)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:860)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:222)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at com.example.dailyplanner.MainActivity.onCreate(MainActivity.java:24)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.app.Activity.performCreate(Activity.java:4562)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.app.ActivityThread.access$600(ActivityThread.java:128)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.os.Looper.loop(Looper.java:137)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at android.app.ActivityThread.main(ActivityThread.java:4514)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at java.lang.reflect.Method.invokeNative(Native Method)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at java.lang.reflect.Method.invoke(Method.java:511)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
09-24 05:49:22.322: E/SQLiteDatabase(9062):     at dalvik.system.NativeStart.main(Native Method)`

here is my android manifest:

<manifest package="com.example.dailyplanner"

    android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res
/android" android:versionCode="1">



    <uses-sdk

        android:minSdkVersion="9"

        android:targetSdkVersion="15" />



<application

    android:icon="@drawable/ic_launcher"

    android:label="@string/app_name"

    android:theme="@android:style/Theme.Light.NoTitleBar" >

    <activity

        android:name=".MainActivity"

        android:label="@string/title_activity_main"

        android:screenOrientation="portrait" 

        android:configChanges="orientation|keyboardHidden">

        <intent-filter>

            <action android:name="android.intent.action.MAIN" />


            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".new_task"/>
</application>

`

and here’s the code of the 2 java files:

import android.os.Bundle;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends ListActivity {

    @Override
        public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        SQLiteDatabase db = openOrCreateDatabase("MyDB", MODE_PRIVATE, null );
        db.execSQL("CREATE TABLE IF NOT EXISTS Data1 (Id INT IDENTITY(1,1) NOT NULL, text VARCHAR, time TIME, date DATE)");



        Button nTaskBtn = (Button) findViewById(R.id.nTask);
        nTaskBtn.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {

                Intent nTaskScreen = new Intent(MainActivity.this, new_task.class);



                startActivity(nTaskScreen);



            }
        });

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}

second file:

import android.R.string;
import android.app.Activity;
import android.app.TimePickerDialog;
import android.net.UrlQuerySanitizer.ValueSanitizer;
import android.os.Bundle;
import android.renderscript.Sampler.Value;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.TimePicker;
public class new_task extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.new_task);

        TextView timeTxt = (TextView) findViewById(R.id.timeTxt);
        TextView dateTxt = (TextView) findViewById(R.id.dateTxt);

        Button btnSave = (Button) findViewById(R.id.btnSave);
        btnSave.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {



            }
        });



        Button btnSetTime = (Button) findViewById(R.id.btnSetTime);
        btnSetTime.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {




            }
        });



        }


    }

any help would be appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:44:11+00:00Added an answer on June 11, 2026 at 6:44 pm

    Look at the logcat error clearly, especially this line..

    09-24 05:49:22.297: E/AndroidRuntime(9062): Caused by: java.lang.RuntimeException: Binary XML file line #24: You must supply a layout_width attribute.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make an android app (I'm new in the Android programming world),
i am new to android programming and i am trying to develop an app
I am new to android programming and i am trying to develop this app
I'm new in Android Programming. I'm trying to write an app that uses USB
I am new to android programming and trying to build a map activity app.
Hi I'm new to Android Programming and I'm trying to make a simple program
i'm new in android programming, i'm trying make dynamic depended spinner by pass a
I am new in Android Programming and I am trying to include GTalk application
I'm new to Android programming. I spent a long time trying to look for
I'm still new to programming/Java/Android so I'm trying to understand everything I do and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.