Issues when using a library project in android - android

I have developed a Project. it is working fine. so i want to use this project as a library for some other project. so i have created this project as a library. Later i have created new Application and added this library project to my new Application Project. then i run the app .
suddenly the previous screen in the activity stack is finishing automatically. i am not getting why this is Happening. Any one have the idea about this issue , Please suggest me

Even though it is added as a library project.
You still need to add the activities that you are calling/using(from the library project) in your new projects AndroidManifest.xml
Though I must say, you should consider showing your logcat and calling code.

Have you set reference to your project?
Rightclick on your project-properties-android-islibrary mark it and add

android:noHistory="true".
beacause of this attribute. stack history was removed. by removing this attribute it working fine

Related

ActionBarSherlock and appcompat_v7

I have had an old application project that uses ActionBarSherlock. I have found it, and made a few changes to it. Now, I need to add new activities to the project, but when I try to do so, eclipse give me a lot of errors. The reason behind the errors is - I think - that the ActionBarSherlock and appcompat_v7 is interfering with each other as they are using the same resources. So my question is: Is there any way I can add new activities to my project without importing the new support library? (if I add them manually or copy them, they won't be in Manifest.xml)
Thanks in advance.
So my question is: Is there any way I can add new activities to my project without importing the new support library?
Sure. Just don't use the new-activity wizard. Create the Java class the way you would any other Java class. Create the resources the way you would any other resources. Add the <activity> element to the manifest manually. And you're set.

How to make a phonegap project as library in android?

I have already created an phonegap android project and it is working fine, now i would like to create same kind of project againg. Might it would be more than 5 apps, so i thought making it as library.
I have make the project as library and created a new project with different package name. Change the launcher activities name to the libraries launcher activity name. But now the issue is application error is happening, cannot load the index.html file.
So i think the way worked on is not the proper one, can anyone please help me to solve this problem.
you have to assign your initial android project as a library. right click the project, pick properties, then go to android, tick the "is library" box and apply
For your new projects, you need to "add" the project before as your library as the image above

Switching from support-lib-v7-appcompat to actionbarsherlock lib in existing project

I want to ask, if is there some way how to change support-library-v7-appcompat to actionbarsherlock lib in existing project. I've tried it many times and ways and I still get the same error - it removes all R.java folders and shows: Jar mismatch - fix your dependencies! I've already tried to put actionbarsherlock lib to new project and it works well. It only doesnt work, when I want to switch from another support-lib.
Do you have any idea, how to solve this problem?
Thank you very much
By the way:
I am doing it because it seems that appcompat doesnt support SearchView for API 7 but sherlock does - from what I read. Second think is, that my application project which has to be supported by sherlock is copy of another one. - I dont know, if it is important for this question.
So I've solved it this way:
I've created new project and added support library ActionBarSherlock
A copied all of previous project to current - using Sherlock
I put the same package to second project
And of course I had to change some things in classes (Fragment to SherlockFragment etc.)

Android ActionBarCompat Not working from the start

OK, I have been wanting to try the new ActionBarCompat, however, I am not able to run my programs in the emulator.
I have been trying to implement the following: http://antonioleiva.com/actionbarcompat-how-to-use.
and have been stuck on basically the first part. However, working with the author of that content, I was able to get further as I was not adding the project under sdk\extras\android\support\v7\appcompat folder like stated. However, I still think that might be the reason I cannot do this...
More detail can be found here: http://antonioleiva.com/actionbarcompat-how-to-use/#comment-43
Basically, on my first attempt, I just created an Android project, and changed the source code as indicated. Code would not run on the emulator. So I went back to the original code, and that ran on the emulator.
Checked online, found out I might need to add the \extras\android\support\v7\appcompat folder as a library to the project I am building. So I added that and a new android project was created. There were build errors from the start, but I failed at trying to add it as a library to my project, and deleted it....thinking this was way overboard.
After back and forth chats with author of linked website, I found out I had to do that overboard thing.
So I tried the following link to the T: (I cannot post more than 2 links due to low repuation...I will add this link as a comment below)
However, Eclipse would not allow me to add the appcompat Existing Android Project...but it did allow me to add the appcompat Existing (General) Project. I think this may be some of the problems??
Right now, I cannot run the project at all. Eclipse is showing a red exclamation mark on the project folder, but all the code seems to be fine. So I don't know what to do now...I recreated this project several times over, and this one was the one where I knew what to do...and I am still getting problems
So...
I decided to move to Android Studio...updated the IDE, updated the SDK manager to include the new support library, and other things. Created a new project, added to the build.gradle file as shown in the link provided below in the comment. I ran the ant build, and then built the project...tried to import the right things to allow ActionBarActivity, but I could not get that far.
I can import
"android.support.v7.*"
"android.support.vy.R" // and all folders within
but nothing allows me to add ActionBarActivity, and I don't know why.
FYI, I guess I would prefer a solution to Ecplise, as it seems like I actually got somewhere with it.
The best example to use is from here, and I would follow it closely. I had similiar issues when I first came across this. Problem was I misunderstood what I needed to do
http://developer.android.com/tools/support-library/setup.html#libs-with-res

Android: Change in library project doesn't change App

My Android app uses a library project which i've imported in Eclipse. So far everything works great. But now i try to change the library project (String.xml and the interface). I can see both changes in the graphical layout editor, but in the main app it doesn't changed.
I allready tried, restarts, cleans, remove and add again, nothing works, any ideas?
Thank you!

Categories

Resources