1

I'm playing with the action bar and I want to use it in the older version of android.

I try to import library as BoredT said in this topic, when I imported library byimport/Existing Project into Workspace and find this folder(sdk/extras/android/support/v7/appcompat). I get error like this: Adb connection Error:An existing connection was forcibly closed by the remote host

When I try to make it one more time I see the info that project already exists in the workspace. Ok so I try make reference to it. I added the android-support-v7-appcompat, then I cleaned my project and rebuild, but I haven't got any new things in gen folders.

I don't know where is mistake. I want to import this library because I need to make ActionBar.

When I add the android-support-v7-appcompat.jar file from ...sdk\extras\android\support\v7\appcompat\libs. I get a problem if I manipulate with theme in AndroidManifest.xml, so I delete this file from libs folder in my project.

Community
  • 1
  • 1
MyWay
  • 1,011
  • 2
  • 14
  • 35

3 Answers3

1

you are importing the wrong way, you need to select Existing android code into workspace then it should be imported and then you can reference the library project into your project.

check this link

http://developer.android.com/tools/support-library/setup.html

tyczj
  • 71,600
  • 54
  • 194
  • 296
  • Now I get "Cannot import android-support-v7-appcompat because the project name is in use" when I want to import by existing androind code into workspace, changing the name of project not solve this error – MyWay Aug 28 '13 at 15:17
  • clearly you have something already imported with that name for some reason, check your workspace – tyczj Aug 28 '13 at 15:50
  • When I restarted eclipse, the old project appear, so I can fix the problem in properly way ;) I saw this website, but this is the next time when my hot blooded character appears. I must work with my nature's disadvantages, since I'm wasting a lot of time because of it :/ Thx for help and this website explaining the topic very clearly – MyWay Aug 29 '13 at 07:52
0

Please read this guide carefully. It fully explains how to add the Action Bar from the support library.

Android developer guide - ActionBar

metter
  • 1,434
  • 11
  • 22
0

Probably you have an existing andorid project library in your workspace. The default name during the import (which you cannot change yet) is android-support-v7-appcompat. Rename the existing one, then import the new one and rename it as necessary. Add the dependency to your project by right CLick on your project, Properties. Android.. and in Lbrary section choose your newly added and renamed library project.

troger19
  • 1,159
  • 2
  • 12
  • 29