I developed an android application with no errors. It is installed in my phone and functioning perfectly but the only problem is, when I'm installing the application. It is installing all the classes in application individually and along with it my main application.
So, how should I prevent all the classes installing individually. please help me.
I am guessing that your AndroidManifest.xml has multiples of this:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Which is causing multiple icons to be showed for each Activity
Find all the "extra" ones and delete them. This used to be an issue with the ADT plugin a while back (every time you made a new Activity via the wizard, it would auto add it with launcher attributes), you seem to be on an older version. You should update it.
Related
I'm trying to fiddle with Google Glass for a project of mine. And when I created a new Immersion project, it cannot find any default Activity. And when I looked at the manifest, it doesn't have the usual <action android:name="android.intent.action.MAIN" /> and <category android:name="android.intent.category.LAUNCHER" /> in it so I added them. It can be played on the Glass now but it just showed another screen (or it's called a Card maybe? I'm still new in this.) and it just got dismissed automatically. Why did this happen? How do I fix this?
Thanks.
Nvm. I'll downgrade my GDK. But I don't know how actually. Anyway, I'll close this question and just try to find how to downgrade.
When I am debugging my Android App, I see multiple apps of it installed on my device, each one seems to be of an holder version. This is really annoying because most are bugged and crash on launch. Anyway I can have Android studio just install the current version.
I've tried to uninstall all the app (uninstalling one uninstalls them all) and re-launching it and It adds them back. I am debugging, not building APK's.
Thank you.
Try deleting the old not working project folders.
Are you accidentally building and deploying multiple flavours? How does your modules .gradle file look like?
Edit: you might want to check this: https://stackoverflow.com/a/27633032/3540885 (Have you set up more than one activity to be launched at start?)
I believe there could be various reasons for multiple installation of app during debug. I also faced similar issue once for one of my app and I after a thorough analysis I found AndroidManifest.xml was the culprit, though it was my mistake as at some point while adding and testing multiple activities I defined two of the activities as launcher activities and hence it was creating two instances of the app when I was debugging.
Check if in your case too, you have defined multiple activities as launcher activities.
Following code part should only exist for your actual launcher activity which you want to launch when you app starts.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
So I'm learning android programming and everything is going well, until I came to this problem.
I'm using android studio and transfer my app to my phone, this has worked well until now. The app start automatically and works fine, but when I go back to the home screen on my phone the app is not there, it's not saved on my phone. The problems is the same when using the emulator.
anyone know this problem?
Most probably you need a line in the android manifest that tells us that the app will appear in the launcher.
Check this link out :
https://groups.google.com/forum/m/#!topic/android-developers/csokbhepUG0
In your manifest, add this to your main activity:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
You probably already have the MAIN action on the activity, you just need to add the category <category android:name="android.intent.category.LAUNCHER" /> so that it shows up on the launcher.
Whenever I run an Android app from eclipse and downloaded into a phone,there will be a duplication of the application I downloaded. For instance my app is called "MyAndroidApp" and when I run it into my phone, there is two application of "MyAndroidApp". Does anyone know why?
Look at your manifest, you must have two
<category android:name="android.intent.category.LAUNCHER" />
declared
I have an app, let us call it 'com.company.foo', with a main Activity 'FooBar'. In my AndroidManifest.xml, I have
<application android:label="#string/app_name"
android:icon="#drawable/icon"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<activity android:name="FooBar"
android:label="#string/app_name"
android:configChanges="keyboardHidden|orientation" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
...
</application>
(where the dots contain other activities inside my app). In this form, it works fine on my HTC desire and on the emulator. However, a (very) small number of people who downloaded the app from the market report a crash with
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.company.foo/com.company.foo.FooBar}: java.lang.ClassNotFoundException: com.company.foo.FooBar in loader dalvik.system.PathClassLoader[/mnt/asec/com.company.foo-1/pkg.apk]
Someone suggested to replace the android:name="FooBar" with android:name=".FooBar", which again works fine on my phone and the emulator, but fails on some other devices. If I leave this attribute out altogether it will not let me install at all.
Any ideas?
I have an app published on Android Market. And sometimes I receive similar crash reports. Seems that's not your fault. This can be reproduced if your app is installed on SD card. Eject this card without unmounting it and run your app.
Additional information can be found here.
The code that you have shown is fine, can't see anything wrong with it - so what else have you looked at?
Have you checked the SDK level against the android release on teh phones that have failed? Any chance of some incompatability there?
Instantiating the activity I have found to my cost is a non-trivial matter and there are so many things to go wrong - you will have to go back over all your support files and make sure that they are clean but think about incompatabilities.
You have not said what imports are involved - have you tried cutting down your app to the bare minimum and see does it still cause problems with those small number of rogue phone - maybe you dont have access to the phones?
Try posting the phone makes/models that are causing problems, also where to access your app and there might be someone out here with the same make/model who would be willing to do some testing for you
Sorry I can't be more help,
Good Luck!!
Oliver