the application *** has stopped unexpectedly. Please try again


Last Updated:

  1. cb03

    cb03 Member This Topic's Starter

    Joined:
    Apr 27, 2010
    Messages:
    6
    Likes Received:
    0
    hi everybody.
    I'm writing a program based on the example on web. It's ok but when i run it, there is a dialog show"the application Hello Tab widget(process.com.goolke.packagea) has stopped unexpectedly. Please try again"
    I don't know why.
    Help me, please!!
     

    Advertisement
  2. disco6stu9

    disco6stu9 Member

    Joined:
    Apr 25, 2010
    Messages:
    10
    Likes Received:
    7
  3. cb03

    cb03 Member This Topic's Starter

    Joined:
    Apr 27, 2010
    Messages:
    6
    Likes Received:
    0
    Here's the example I wrote. I try to debug it but I don't really understand that message. Could u see the code and help me a little???????????
    ~thanks so much~
     

    Attached Files:

  4. disco6stu9

    disco6stu9 Member

    Joined:
    Apr 25, 2010
    Messages:
    10
    Likes Received:
    7
    You made a couple of mistakes when copying this example from the Android site:

    Tab Layout | Android Developers

    1. You need to place the drawable (pictures + xml) resources in the res/drawable/ directory instead of res/drawable-hdpi/ directory.
    2. The xml files you created (ic_tab_artists.xml, etc.) have an extra <resources> + </resources> XML tag pair. You should remove these tags from all three ic_tab_* files.
    3. You need to update your Android manifest to define activities for ArtistsActivity, AlbumsActivity & SongsActivity (I think this step is not obvious from the web page).
     
    Tsawm Shayi and dw3105 like this.
  5. cb03

    cb03 Member This Topic's Starter

    Joined:
    Apr 27, 2010
    Messages:
    6
    Likes Received:
    0
    There're 2 activities in the example below. But I just see an activity is defined in the Android manifest????? So I did the same with the example above( didn't defined 3 activities in the android manifest)
    Could u explain more for me?????
     

    Attached Files:

  6. disco6stu9

    disco6stu9 Member

    Joined:
    Apr 25, 2010
    Messages:
    10
    Likes Received:
    7
    I attached a working version of the sample you are building.

    The code written inside of onCreate instantiates three Intent objects. In order for these objects to work properly the Android Manifest needs define an Activity in the Android manifest in order to launch the appropriate code when you click on a Tab.

    Every Android manifest has at least one Activity definition - i.e. the one that is executed when the application launches. Typically, if your class extends Activity or some child class of Activity, then you will want to include information about this class in your Android activity.

    You can read more about Activities on the Android developer website:
    Activity | Android Developers
     

    Attached Files:

    vizoere, ajaypatelaj, dw3105 and 2 others like this.
  7. anu8is

    anu8is New Member

    Joined:
    Oct 1, 2010
    Messages:
    1
    Likes Received:
    0
    Im having the same problem. can u help me
     

    Attached Files:

  8. androidhelper

    androidhelper New Member

    Joined:
    Feb 4, 2011
    Messages:
    1
    Likes Received:
    1
    1) I created new drawable folder and copied all images and xml file in it
    2) Update the manifest xml file as shown below

    and it works

    Cheers guys :)



    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.hellotabwidget" android:versionCode="1"
    android:versionName="1.0">
    <uses-sdk android:minSdkVersion="9" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".AlbumsActivity" android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar">
    </activity>
    <activity android:name=".ArtistsActivity" android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar">
    </activity>
    <activity android:name=".SongsActivity" android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar">
    </activity>


    <activity android:name=".HelloTabWidget" android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>

    </application>
    </manifest>
     
    Tsawm Shayi likes this.
  9. ajaypatelaj

    ajaypatelaj New Member

    Joined:
    Mar 28, 2011
    Messages:
    3
    Likes Received:
    0
    it should be like this... for abow zip file

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.googke.packagea"
    android:versionCode="1"
    android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".HelloTabWidget" android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>

    <activity android:name="ArtistsActivity" android:theme="@android:style/Theme.NoTitleBar" android:label="artists"></activity>
    <activity android:name="AlbumsActivity" android:theme="@android:style/Theme.NoTitleBar" android:label="albums"></activity>
    <activity android:theme="@android:style/Theme.NoTitleBar" android:name="SongsActivity" android:label="songs"></activity>
    </application>
    <uses-sdk android:minSdkVersion="7" />

    </manifest>
     
  10. shiva.kore

    shiva.kore New Member

    Joined:
    Apr 26, 2011
    Messages:
    1
    Likes Received:
    0
    Hi friends ,


    I am also getting error as "Application stopped unexpectedly". pls find here with attached code.

    Thanks.
     

    Attached Files:

  11. Stef4n

    Stef4n New Member

    Joined:
    Aug 17, 2011
    Messages:
    1
    Likes Received:
    0
    hey, i've got the same problem,
    I checked all my files and compared them to the working version of disco6stu9
    and i haven't found any differences, except for var names

    please check my file and help me if u can, i'm already despaired of it

    Edit: Found the problem by myself. I had a 7 where a / should have been
     

    Attached Files:

  12. mokhtar_justm

    mokhtar_justm New Member

    Joined:
    Sep 25, 2011
    Messages:
    1
    Likes Received:
    0
    i have the same problem ... can u check it for me please ???


    thanks in advance
     
  13. rajeshvaddi

    rajeshvaddi New Member

    Joined:
    Oct 18, 2011
    Messages:
    1
    Likes Received:
    0
    Hope below could be a possible solution for the problem.


    Check the VM size of the Emulator so that its good enough to run your app in its VM. Check the Size of your . Keep it in min sized so that Emulator will not find any difficulties in executing your app..


    Cheers,

    Rajesh Vaddi
     
  14. markdroid1

    markdroid1 New Member

    Joined:
    Apr 5, 2013
    Messages:
    1
    Likes Received:
    0
    Hi guys i have the same problem..i am making an application with database. can you help me with this? please. thanks....
     

    Attached Files:

Share This Page

Loading...