Tuesday, February 21, 2012

Android common errors

1. Import error

Importing project : Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
    What to do :
    1.  Right click on the Project
    2. Select Android Tools, Select Fix Project Properties.


    2.  ActivityNotFoundException exception

    One of the common exception is ActivityNotFoundException. Whenever we create any screen nothing but activity, we need to specify the activity in AndroidManifest.xml. If you forgot to specify the Activity then it leads to  ActivityNotFoundException exception.

    Syntax:
    <activity
                android:name=".HelloActivity"
                android:label="Welcome to Hello world" >
     </activity>