user1540293
user1540293

Reputation: 59

Eclipse- creating new Activity

I have problem when I create a new Android project. I fill in the name of the app and the package name, then I go to the next scrren and set the icon. On the following scrren I select Blank activity and hit next when this screen appears:

Eclipse create activity dialog

I enter everything, but i donť know what to do with Hierarchical Parent. A few days ago it worked perfectly, but now when I chose something from list on the left, and create activity, eclipse unless I wrote something says it's wrong.

Can anyone help me?

Upvotes: 6

Views: 10679

Answers (6)

Kenrick
Kenrick

Reputation: 31

I got the same problem like yours. After a day, I found the way.

It's very simple. re install the ADT Plugin: In Eclipse, Help > Install New Software.... Click Add, in the top-right corner. Enter "ADT Plugin" for the Name and URL = http://dl-ssl.google.com/android/eclipse/ Then just enter until finish

For the full tutorial how to instal ADT Plugin you can look at: http://developer.android.com/sdk/installing/installing-adt.html

Upvotes: 3

paiego
paiego

Reputation: 3787

The problem is a bug with the Application Wizard... which tries to integrate the Activity Wizard within itself. The problem is that the integrated Activity Wizard doesn't work correctly without there being an existing project.

Therefore, an easy solution to this problem is from the Project Wizard, just create a basic main activity with "none" for navigation type and click "finish". Then once the project has been created, use the Activity Wizard to create your desired main Activity.

As a bonus, the Activity Wizard will even refactor the code to use this new Activity as your main Activity!

Upvotes: 0

ITForHumanity
ITForHumanity

Reputation: 1

Platform-tools version 14 has this problem, but not version 13.

http://dl-ssl.google.com/android/repository/platform-tools_r13-linux.zip

I backed up my current (problematic) /android-sdk/platform tools, deleted the old folder and replaced it with ver 13, started eclipse, reset the android-sdk path (windows>preferences>android, don't forget to click "apply") and recreated my AVD.

Version 13 also has the heirarchical parent text box, but it's optional.

Upvotes: 0

gary
gary

Reputation: 1

1.Copy your Package Name, then past to "Hierarchical Parent" Field. (any words to skip this step)

2.AndroidManifest.xml need an "android.intent.action.MAIN" for start. Add follow source code

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

like this:

<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>

Upvotes: 0

AITAALI_ABDERRAHMANE
AITAALI_ABDERRAHMANE

Reputation: 2519

Your error concerns the name of the activity verify the project build sdk

the hierarchical parent activity is used normally to provide a default implementation for the UP button

Upvotes: 0

Chilledrat
Chilledrat

Reputation: 2605

For an Activity set it to android.app.activity.

Upvotes: 3

Related Questions