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 9222265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:47:47+00:00 2026-06-18T03:47:47+00:00

I dont understand where the error occurs, and my application tends to Force Close.

  • 0

I dont understand where the error occurs, and my application tends to “Force Close”. Please help me out with this. I’ve never seen such errors before.
This is my xml file:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/black_red_texture"
tools:context=".AddictionDetails" >

<ImageView
    android:id="@+id/imageViewAddictionDetailsBack"
    android:layout_width="25dp"
    android:layout_height="25dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:src="@drawable/arrow_left"
    android:clickable="true" />

<TextView
    android:id="@+id/textViewAddictionDetails"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/imageView1"
    android:layout_centerHorizontal="true"
    android:text="Addiction Details"
    android:textSize="20sp" />

<TableLayout
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="false"
    android:layout_below="@id/textViewAddictionDetails"
    android:layout_centerHorizontal="true"
    android:background="#AAA8A8A8"
    android:shrinkColumns="1" >

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="10dp" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="right"
            android:text="Today:" />

        <TextView
            android:id="@+id/textview_today"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_weight="1"
            android:text="today" />
    </TableRow>

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="10dp" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="right"
            android:text="Yesterday:" />

        <TextView
            android:id="@+id/textview_yesterday"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_weight="1"
            android:text="yesterday" />
    </TableRow>

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="10dp" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="right"
            android:text="This Week:" />

        <TextView
            android:id="@+id/textview_this_week"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_weight="1"
            android:text="this week" />
    </TableRow>

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="10dp" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="right"
            android:text="This Month:" />

        <TextView
            android:id="@+id/textview_this_month"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_weight="1"
            android:text="this month" />
    </TableRow>

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="10dp"
        android:paddingTop="10dp" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="right"
            android:text="Total:" />

        <TextView
            android:id="@+id/textview_total"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_weight="1"
            android:text="total" />
    </TableRow>
</TableLayout>
</RelativeLayout>

This is my source file:

package com.addictioncounterapp;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class AddictionDetails extends Activity 
{
TextView tv_addiction_name, tv_today, tv_yesterday, tv_this_week, tv_this_month, tv_total;
ImageView iv_back;

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_addiction_details);

    tv_addiction_name = (TextView) findViewById(R.id.textViewAddictionDetails);
    tv_total = (TextView) findViewById(R.id.textview_total);
    tv_today = (TextView) findViewById(R.id.textview_today);
    tv_yesterday = (TextView) findViewById(R.id.textview_yesterday);
    tv_this_week = (TextView) findViewById(R.id.textview_this_week);
    tv_this_month = (TextView) findViewById(R.id.textview_this_month);

    iv_back = (ImageView) findViewById(R.id.imageViewAddictionDetailsBack);
    iv_back.setClickable(true);
    iv_back.setOnClickListener(new OnClickListener()
                                    {
                                        @Override
                                        public void onClick(View v)
                                        {
                                            Intent intent = new Intent(AddictionDetails.this, StartActivity.class);
                                            startActivity(intent);
                                        }
                                    }
                                );

    Intent intent = getIntent();
    String cat_name = intent.getStringExtra("cat_name");

    tv_addiction_name.setText(cat_name);

    SQLiteDatabase db = openOrCreateDatabase("AddictionCounter.db", SQLiteDatabase.OPEN_READWRITE, null);

    Cursor cursor = db.query("category", new String[]{"cat_id"}, "cat_name=?", new String[]{cat_name}, null, null, null);

    //----------------------fetching id-------------------

    int cat_id = 0;
    if(cursor.getCount() > 0)
        while(cursor.moveToNext())
            cat_id = cursor.getInt(0);
    cursor.close();

    //----------------------fetching total-------------------

    int total;
    cursor = db.query("counter", new String[]{"cat_id"}, "cat_id=?", new String[]{cat_id+""}, null, null, null);
    total = cursor.getCount();
    tv_total.setText(total+"");

    //----------------------fetching today's count---------------

    cursor = db.query("counter", new String[]{"counter_entry_date"}, "cat_id=?", new String[]{cat_id+""}, null, null, null);

    Calendar cal1 = Calendar.getInstance();
    SimpleDateFormat dateFormat1 = new SimpleDateFormat("dd/MM/yyyy");

    String todays_date = dateFormat1.format(cal1.getTime());
    String cursor_date;
    int counter = 0;
    if(cursor.getCount() > 0)
    {
        while(cursor.moveToNext())
        {
            cursor_date = cursor.getString(0)+"";
            if(cursor_date.equals(todays_date))
                counter++;
        }
    }
    tv_today.setText(counter+"");

    //----------------------fetching yesterdays count------------------

    Calendar cal2 = Calendar.getInstance();
    SimpleDateFormat dateFormat2 = new SimpleDateFormat("dd/MM/yyyy");
    cal2.add(Calendar.DATE, -1);

    String yesterdays_date = dateFormat2.format(cal2.getTime());

    counter = 0;
    cursor.moveToFirst();
    if(cursor.getCount() > 0)
    {
        while(cursor.moveToNext())
        {
            cursor_date = cursor.getString(0)+"";
            if(cursor_date.equals(yesterdays_date))
                counter++;
        }
    }
    tv_yesterday.setText(counter+"");

    //-------------------------fetching current week count--------------------

    ArrayList<String> current_week_dates = new ArrayList<String>();

    Calendar c = Calendar.getInstance();
    c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
    SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
    for (int i = 0; i < 7; i++)
    {
        current_week_dates.add(df.format(c.getTime()));
        c.add(Calendar.DATE, 1);
    }

    counter=0;
    cursor.moveToFirst();
    while(cursor.moveToNext())
    {
        if(current_week_dates.contains(cursor.getString(0)))
        {
            counter++;
        }
    }
    tv_this_week.setText(counter+"");

    //----------------------fetching current month count--------------------

    cursor.moveToFirst();
    counter=0;

    Date date = new Date();
    SimpleDateFormat sdf;

    sdf = new SimpleDateFormat("MM/yyyy");
    String current_month= sdf.format(date);

//      Toast.makeText(getBaseContext(), current_month, Toast.LENGTH_SHORT).show();

    while(cursor.moveToNext())
    {
        if((cursor.getString(0)).matches("(.*)"+current_month))
        {
            counter++;
        }
    }
//      Toast.makeText(getBaseContext(), counter+"", Toast.LENGTH_SHORT).show();

    tv_this_month.setText(counter+"");
    cursor.close();
}
}

this is my error log:

02-01 10:58:03.904: D/dalvikvm(403): GC_EXTERNAL_ALLOC freed 53K, 53% free 2559K/5379K, external 716K/1038K, paused 76ms
02-01 10:58:10.544: D/dalvikvm(403): GC_EXTERNAL_ALLOC freed 25K, 52% free 2620K/5379K, external 8173K/8699K, paused 65ms
02-01 10:58:10.584: E/dalvikvm-heap(403): 6400000-byte external allocation too large for this process.
02-01 10:58:10.704: E/GraphicsJNI(403): VM won't let us allocate 6400000 bytes
02-01 10:58:10.714: D/dalvikvm(403): GC_FOR_MALLOC freed 2K, 52% free 2618K/5379K, external 8173K/8699K, paused 50ms
02-01 10:58:10.714: D/skia(403): --- decoder->decode returned false
02-01 10:58:10.714: D/AndroidRuntime(403): Shutting down VM
02-01 10:58:10.714: W/dalvikvm(403): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-01 10:58:10.755: E/AndroidRuntime(403): FATAL EXCEPTION: main
02-01 10:58:10.755: E/AndroidRuntime(403): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.addictioncounterapp/com.addictioncounterapp.AddictionDetails}: android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.os.Looper.loop(Looper.java:123)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.app.ActivityThread.main(ActivityThread.java:3683)
02-01 10:58:10.755: E/AndroidRuntime(403):  at java.lang.reflect.Method.invokeNative(Native Method)
02-01 10:58:10.755: E/AndroidRuntime(403):  at java.lang.reflect.Method.invoke(Method.java:507)
02-01 10:58:10.755: E/AndroidRuntime(403):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-01 10:58:10.755: E/AndroidRuntime(403):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-01 10:58:10.755: E/AndroidRuntime(403):  at dalvik.system.NativeStart.main(Native Method)
02-01 10:58:10.755: E/AndroidRuntime(403): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.view.LayoutInflater.createView(LayoutInflater.java:518)
02-01 10:58:10.755: E/AndroidRuntime(403):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-01 10:58:10.755: E/AndroidRuntime(403):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.app.Activity.setContentView(Activity.java:1657)
02-01 10:58:10.755: E/AndroidRuntime(403):  at com.addictioncounterapp.AddictionDetails.onCreate(AddictionDetails.java:27)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
02-01 10:58:10.755: E/AndroidRuntime(403):  ... 11 more
02-01 10:58:10.755: E/AndroidRuntime(403): Caused by: java.lang.reflect.InvocationTargetException
02-01 10:58:10.755: E/AndroidRuntime(403):  at java.lang.reflect.Constructor.constructNative(Native Method)
02-01 10:58:10.755: E/AndroidRuntime(403):  at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.view.LayoutInflater.createView(LayoutInflater.java:505)
02-01 10:58:10.755: E/AndroidRuntime(403):  ... 21 more
02-01 10:58:10.755: E/AndroidRuntime(403): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.content.res.Resources.loadDrawable(Resources.java:1709)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.view.View.<init>(View.java:1951)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.view.View.<init>(View.java:1899)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.view.ViewGroup.<init>(ViewGroup.java:286)
02-01 10:58:10.755: E/AndroidRuntime(403):  at android.widget.RelativeLayout.<init>(RelativeLayout.java:173)
02-01 10:58:10.755: E/AndroidRuntime(403):  ... 24 more
02-01 10:58:12.765: I/Process(403): Sending signal. PID: 403 SIG: 9
  • 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-18T03:47:48+00:00Added an answer on June 18, 2026 at 3:47 am

    Did you try increasing the memory AVD ? just a suggestion …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't understand why I'm getting this error. I used the same code previously
This code of mine keeps on throwing error i don't understand why. var id
This code is giving me this error, which I don't understand. I can't even
In my ASP.Net Web-Application, I'm getting this error: Conversion from type 'DBNull' to type
I don't understand the error because it appears to be requiring a version of
I've strange error i don't understand. I'm just moving my code from jQuery over
I don't understand why I'm getting a EXC BAD ACCESS error when I call
I am getting an error that I don't understand how to fix. The error
I am getting the following error, which I don't understand... 06-15 22:06:49.196: W/dalvikvm(17622): threadid=1:
When using scipy.optimize 's fmin I'm getting an error I don't understand: ValueError: setting

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.