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

The Archive Base Latest Questions

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

I’m new in android development. I have been trying to start a new activity

  • 0

I’m new in android development. I have been trying to start a new activity after pressing an image button. But when I try to run it in the emulator I always get an error: “AppName has stopped”.

Here is my code:
Image button:

 <ImageButton
        android:id="@+id/FirstAidButton"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_toLeftOf="@+id/BodyMassIndex"
        android:background="@null"
        android:contentDescription="@string/firstaid"
        android:src="@drawable/firstaid" 
        android:onClick="fatTutorial" />

Java:

public void fatTutorial(View view) {
        Intent intent = new Intent(this, FirstAidTutorial.class);

        startActivity(intent);
    }

Manifest:

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

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

<application
    android:icon="@drawable/drdroid"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".Home"
        android:label="@string/title_activity_home" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
   <activity android:label="@string/title_text" android:name="dr.droid.FirstAidTutorial"/>

   </application>

</manifest>

Receiving class(FirstAidTutorial):

    @Override
    public void onCreate(Bundle savedInstanceState) {
        Intent intent = getIntent();
    }

LogCat:

   08-20 18:13:28.428: E/Trace(633): error opening trace file: No such file or directory (2)
08-20 18:13:28.898: D/dalvikvm(633): GC_FOR_ALLOC freed 256K, 4% free 8140K/8455K, paused 66ms, total 71ms
08-20 18:13:29.008: D/dalvikvm(633): GC_FOR_ALLOC freed 194K, 5% free 8254K/8647K, paused 40ms, total 41ms
08-20 18:13:29.619: I/Choreographer(633): Skipped 81 frames!  The application may be doing too much work on its main thread.
08-20 18:13:29.738: D/gralloc_goldfish(633): Emulator without GPU emulation detected.
08-20 18:13:32.068: D/AndroidRuntime(633): Shutting down VM
08-20 18:13:32.098: W/dalvikvm(633): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
08-20 18:13:32.388: E/AndroidRuntime(633): FATAL EXCEPTION: main
08-20 18:13:32.388: E/AndroidRuntime(633): java.lang.RuntimeException: Unable to start activity ComponentInfo{dr.droid/dr.droid.FirstAidTutorial}: android.view.InflateException: Binary XML file line #8: Error inflating class <unknown>
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.os.Looper.loop(Looper.java:137)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.app.ActivityThread.main(ActivityThread.java:4745)
08-20 18:13:32.388: E/AndroidRuntime(633):  at java.lang.reflect.Method.invokeNative(Native Method)
08-20 18:13:32.388: E/AndroidRuntime(633):  at java.lang.reflect.Method.invoke(Method.java:511)
08-20 18:13:32.388: E/AndroidRuntime(633):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-20 18:13:32.388: E/AndroidRuntime(633):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-20 18:13:32.388: E/AndroidRuntime(633):  at dalvik.system.NativeStart.main(Native Method)
08-20 18:13:32.388: E/AndroidRuntime(633): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class <unknown>
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.view.LayoutInflater.createView(LayoutInflater.java:613)
08-20 18:13:32.388: E/AndroidRuntime(633):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-20 18:13:32.388: E/AndroidRuntime(633):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.app.Activity.setContentView(Activity.java:1867)
08-20 18:13:32.388: E/AndroidRuntime(633):  at dr.droid.FirstAidTutorial.onCreate(FirstAidTutorial.java:13)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.app.Activity.performCreate(Activity.java:5008)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
08-20 18:13:32.388: E/AndroidRuntime(633):  ... 11 more
08-20 18:13:32.388: E/AndroidRuntime(633): Caused by: java.lang.reflect.InvocationTargetException
08-20 18:13:32.388: E/AndroidRuntime(633):  at java.lang.reflect.Constructor.constructNative(Native Method)
08-20 18:13:32.388: E/AndroidRuntime(633):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.view.LayoutInflater.createView(LayoutInflater.java:587)
08-20 18:13:32.388: E/AndroidRuntime(633):  ... 24 more
08-20 18:13:32.388: E/AndroidRuntime(633): Caused by: android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x1/d=0x7f060000 a=-1 r=0x7f060000}
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.content.res.Resources.loadColorStateList(Resources.java:2035)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.content.res.TypedArray.getColorStateList(TypedArray.java:342)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.widget.TextView.<init>(TextView.java:772)
08-20 18:13:32.388: E/AndroidRuntime(633):  at android.widget.TextView.<init>(TextView.java:442)
08-20 18:13:32.388: E/AndroidRuntime(633):  ... 27 more

firstaidtutorial.xml

<?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:layout_marginTop="10dp"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/AnimalBite"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="@string/animalbite"
        android:textColor="#CC0000"
        android:textColorHint="@style/AppTheme"
        android:textSize="25dp" />


    <TextView
        android:id="@+id/ChokingInfant"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="@string/chokinginfant"
        android:textColor="#CC0000"
        android:textSize="25dp" />


    <TextView
        android:id="@+id/ChokingChild"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="@string/chokingchild"
        android:textColor="#CC0000"
        android:textSize="25dp" />


    <TextView
        android:id="@+id/ChokingAdult"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="@string/chokingadult"
        android:textColor="#CC0000"
        android:textSize="25dp" />


    <TextView
        android:id="@+id/Convulsion"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="@string/convulsion"
        android:textColor="#CC0000"
        android:textSize="25dp" />

    <TextView
        android:id="@+id/CPRAdult"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/cpradult"
        android:padding="5dp"
        android:textColor="#CC0000"
        android:textSize="25dp" />
    <TextView
        android:id="@+id/CPRInfant"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/cprinfants"
        android:padding="5dp"
        android:textColor="#CC0000"
        android:textSize="25dp" />
    <TextView
        android:id="@+id/HeimlichManeuver"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/heimlichmaneuver"
        android:padding="5dp"
        android:textColor="#CC0000"
        android:textSize="25dp" />
    <TextView
        android:id="@+id/MinorBurn"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/minorburn"
        android:padding="5dp"
        android:textColor="#CC0000"
        android:textSize="25dp" />

    <TextView
        android:id="@+id/MinorCut"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/minorcut"
        android:padding="5dp"   
        android:textColor="#CC0000"
        android:textSize="25dp" />

</LinearLayout>

Any ideas? And also, how can I create an xml for that new activity so I can put designs/layouts to it. Thanks!

  • 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-09T22:05:09+00:00Added an answer on June 9, 2026 at 10:05 pm

    Declare FirstAidTutorial Activity in manifest file .

    <activity android:label="@string/title_text" android:name=".FirstAidTutorial"/>
    

    how can I create an xml for that new activity so I can put designs/layouts to it.

    First create one xml file in res -> layout folder then set that file in FirstAidTutorial Activity using setContentView(R.layout.yourlayout);.

    public class FirstAidTutorial extends Activity {
    
        @Override
        public void onCreate(Bundle icicle) {
    
            super.onCreate(icicle);
    
            setContentView(R.layout.yourlayout);
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.