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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:01:05+00:00 2026-06-09T09:01:05+00:00

I have been having a very difficult time with android apps. I’m using Eclipse,

  • 0

I have been having a very difficult time with android apps. I’m using Eclipse, V 4.2.0, and running API version 7. Below is the LogCat output of one program I’m having difficulties. This is my code:

Manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.deadEddie.counter"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="7"
    android:targetSdkVersion="15" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
</application>

</manifest>

layout (activity_main.xml)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" 
android:background="#000000">

<TextView

    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:textColor="@string/color"
    android:textSize="30dp"
    android:text="@string/text"
    android:textStyle="bold"
    android:gravity="center"
    android:id="@+id/tvDisplay"

    />

 <Button
    android:id="@+id/btnAdd"
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:text="@string/btn1Title"
    android:layout_gravity="center" 
    />

  <Button
    android:id="@+id/btnSubtract"
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:text="@string/btn2Title"
    android:layout_gravity="center"
    />


</LinearLayout>

MainActivity.java

package com.deadEddie.counter;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity 
{
int counter;
Button add;
Button subtract;
TextView display;

@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    counter = 0;
    add = (Button) findViewById(R.id.btnAdd);
    subtract = (Button) findViewById(R.id.btnSubtract);
    display = (TextView) findViewById(R.id.tvDisplay);

    add.setOnClickListener(new View.OnClickListener() 
    {

        @Override
        public void onClick(View v) 
        {
            // TODO Auto-generated method stub
            counter ++;
            display.setText("Counter = " + counter);

        }
    });
    subtract.setOnClickListener(new View.OnClickListener() 
    {

        @Override
        public void onClick(View v) 
        {
            // TODO Auto-generated method stub
            counter --;
            display.setText("Counter = "+ counter);
        }
    });

}
}

LogCat output:

08-06 13:23:37.538: E/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory)
08-06 13:23:37.538: E/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)
08-06 13:23:37.538: E/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
08-06 13:23:37.538: E/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)
08-06 13:23:46.518: E/BatteryService(51): usbOnlinePath not found
08-06 13:23:46.518: E/BatteryService(51): batteryVoltagePath not found
08-06 13:23:46.518: E/BatteryService(51): batteryTemperaturePath not found
08-06 13:23:46.528: E/SurfaceFlinger(51): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
08-06 13:23:49.848: E/EventHub(51): could not get driver version for /dev/input/mouse0, Not a typewriter
08-06 13:23:49.848: E/EventHub(51): could not get driver version for /dev/input/mice, Not a typewriter
08-06 13:23:50.638: E/System(51): Failure starting core service
08-06 13:23:50.638: E/System(51): java.lang.SecurityException
08-06 13:23:50.638: E/System(51):   at android.os.BinderProxy.transact(Native Method)
08-06 13:23:50.638: E/System(51):   at     android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
08-06 13:23:50.638: E/System(51):   at android.os.ServiceManager.addService(ServiceManager.java:72)
08-06 13:23:50.638: E/System(51):   at com.android.server.ServerThread.run(SystemServer.java:176)
08-06 13:23:50.638: E/AndroidRuntime(51): Crash logging skipped, no checkin service
08-06 13:23:56.035: E/ActivityThread(95): Failed to find provider info for android.server.checkin
08-06 13:23:56.774: E/ActivityThread(95): Failed to find provider info for android.server.checkin
08-06 13:23:56.844: E/ActivityThread(95): Failed to find provider info for android.server.checkin
08-06 13:23:58.464: E/vold(26): Cannot start volume '/sdcard' (volume is not bound)
08-06 13:23:58.604: E/MediaPlayerService(30): Couldn't open fd for content://settings/system/notification_sound
08-06 13:23:58.614: E/MediaPlayer(51): Unable to to create media player
08-06 13:24:03.963: E/AndroidRuntime(192): ERROR: thread attach failed
08-06 13:24:05.833: E/AndroidRuntime(203): ERROR: thread attach failed
08-06 13:24:06.043: E/jdwp(216): Failed sending req to debugger: Broken pipe (-1 of 27)
08-06 13:24:06.043: E/jdwp(216): Failed sending req to debugger: Broken pipe (-1 of 27)
08-06 13:24:06.043: E/jdwp(216): Failed sending reply to debugger: Broken pipe
08-06 13:24:06.115: E/AndroidRuntime(216): Uncaught handler: thread main exiting due to uncaught exception
08-06 13:24:06.133: E/AndroidRuntime(216): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.deadEddie.counter/com.deadEddie.counter.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class <unknown>
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.os.Looper.loop(Looper.java:123)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.app.ActivityThread.main(ActivityThread.java:4363)
08-06 13:24:06.133: E/AndroidRuntime(216):  at java.lang.reflect.Method.invokeNative(Native Method)
08-06 13:24:06.133: E/AndroidRuntime(216):  at java.lang.reflect.Method.invoke(Method.java:521)
08-06 13:24:06.133: E/AndroidRuntime(216):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-06 13:24:06.133: E/AndroidRuntime(216):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-06 13:24:06.133: E/AndroidRuntime(216):  at dalvik.system.NativeStart.main(Native Method)
08-06 13:24:06.133: E/AndroidRuntime(216): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class <unknown>
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.view.LayoutInflater.createView(LayoutInflater.java:513)
08-06 13:24:06.133: E/AndroidRuntime(216):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
08-06 13:24:06.133: E/AndroidRuntime(216):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.app.Activity.setContentView(Activity.java:1622)
08-06 13:24:06.133: E/AndroidRuntime(216):  at com.deadEddie.counter.MainActivity.onCreate(MainActivity.java:20)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
 08-06 13:24:06.133: E/AndroidRuntime(216):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)

 08-06 13:24:06.133: E/AndroidRuntime(216):     ... 11 more
08-06 13:24:06.133: E/AndroidRuntime(216): Caused by: java.lang.reflect.InvocationTargetException
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.widget.TextView.<init>(TextView.java:320)
08-06 13:24:06.133: E/AndroidRuntime(216):  at java.lang.reflect.Constructor.constructNative(Native Method)
08-06 13:24:06.133: E/AndroidRuntime(216):  at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.view.LayoutInflater.createView(LayoutInflater.java:500)
08-06 13:24:06.133: E/AndroidRuntime(216):  ... 22 more
08-06 13:24:06.133: E/AndroidRuntime(216): Caused by: android.content.res.Resources$NotFoundException: File #CCFF00 from drawable resource ID #0x7f040006: .xml extension required
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.content.res.Resources.loadColorStateList(Resources.java:1820)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.content.res.TypedArray.getColorStateList(TypedArray.java:289)
08-06 13:24:06.133: E/AndroidRuntime(216):  at android.widget.TextView.<init>(TextView.java:627)
08-06 13:24:06.133: E/AndroidRuntime(216):  ... 26 more
08-06 13:24:06.173: E/dalvikvm(216): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
08-06 13:29:06.424: E/gralloc(51): [unregister] handle 0x52d470 still locked (state=40000001)
  • 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-09T09:01:06+00:00Added an answer on June 9, 2026 at 9:01 am

    I think you need to move your color declaration out of strings.xml and put it inside of colors.xml

    colors.xml

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    <color name="myColor">#ccff00</color>
    </resources>
    

    Then inside your layout refer to it like this:

    <TextView
    
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:textColor="@color/myColor"
    android:textSize="30dp"
    android:text="@string/text"
    android:textStyle="bold"
    android:gravity="center"
    android:id="@+id/tvDisplay"
    
    />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been having a very difficult time editing my .htaccess file to do
Ok, I have been having a VERY hard time figuring this out. I guess
Sorry I am very new to open graph and have been having difficulty to
I'm having a really difficult time getting eclipse to play nicely with this external
I have been having this debate with my boss for a long time, now
I have been having a hard time understanding how to use a singleton to
I'm having a very difficult time understanding how a c# form can populate and
I have been having trouble pulling up a custom UIPickerView from the textfield's inputview
I have been having these really odd problems with Visual Studio 2010. At this
I have been having this annoying problem when trying to implement a picture gallery

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.