When I launch my android application from eclipse, it shows the home screen, and I then need to unlock the screen and go to my app. I would like it to just show my app by default.
I have tried right clicking on the app and selecting Run As..., but Android Application is not a choice there. I need to manually create a new Android run configuration for my application and then I launch that.
Is there a way to just make my app show by default? I'm running with the emulator for Android version 2.2?
Note: I'm also getting an error that says "Emulator] Unknown savevm section type 95" which I'm not sure what that means yet
thanks,
Jeff
The emulator always starts with the screen locked. Unlock it and wait a moment, sometimes it needs a minute to launch your app. If it doesn't work after a few moments, leave the emulator open and try running it again. If it doesn't launch now, there's something wrong.
I'm thinking you either didn't create your project as an android project to begin with, or if you did you didn't create a starting activity (or deleted the one that you did create)? Either way, you probably need to go edit your AndroidManifest.xml file and add an intent filter to an activity. Just guessing. Should look similar to this:
<activity
android:name={String for the name of your app}
android:label={String for the name displayed on the icon}>
<intent-filter>
<action
android:name="android.intent.action.MAIN"/>
<category
android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
** posted before your edit ^^^
In terms of your error, I have no clue what that is, so maybe it has nothing to do with your AndroidManifest, then. :T
Check your manifest, and make sure your activity has the correct intent-filter
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
BTW, Previous to Android 1.6 i think the emulator always started with the screen locked then they changed that and it starts with your app
Related
I re-installed my Android Studio. My first problem was, that when I try to run my Activity, I got an error:
Default Activity Not Found
. So I change the configuration, instead of choosing Default Activity in the Launch Option I choose Nothing.
I think this is the problem why nothing is happening after I run the project. It's make sense, cuz nothing is lauch or am I wrong?
The Android Studio see my device and it's connecting via USB. I done this before, so I know that I have to allow USB Debugging on my device and i did. After I hit run, start to loading, and than it's says that:
Install succesfully finished in 212 ms. App restart succedful without
requiring a re-install.
But nothing is happening neither in my computer or my phone.
In order to start your App, it needs an "entry point". You can define it in the AndroidManifest.xml file like:
<activity android:name="com.myapp.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
In the first line you add the package path + your Activity you want to open at startup. The reason why you got the error msg Default Activity not found probably is, that you created a project without an Activity.
To create a new Activity simply right-click to the package in Android Studio -> select New -> Activity -> and then e.g. Empty Activity
Just add a filter tag in the Manifest.xml file to the activity that you want the to starts with
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
I tried to upload a testing app (just blank page) to my phone.
I can see my phone in the list when I press run and there is no new app in my phone and nothing apears there.
why?
thank you.
Firstly, if you app is failing to compile, you will need to check Android Studio for compilation errors. These can be found in the Messages view.
To put your app on a device, your test device will need USB Debugging enabled on it. Please see this answer for more information on how to turn it on should you have missed this step.
If the app is compiling but isn't starting, ensure that you have the following intent-filter within your main activity's definition in your AndroidManifest.xml file.
<activity
android:name=".YourMainActivityName"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This intent filter is how the Android OS works out which activity to launch when the app is freshly opened. Without this filter, no activity will start.
I download my project.apk to my mobile, I install it, at the end it says (Done) and (Open), the (Open) is unhighlighted, I go to (Done). When I look for it to run it, I cant find it, when I go to settings >> Applications to uninstall it, I find it!
Why? :)
In AndroidManifest.xml check if you have this inside the Activity which is your main activity:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
This is the piece of XML that informs which activity is considered the main activity in your android application. If this information is missing, no launcher will be set, which means no way to start your activity. That's why you don't see an icon of your application, neither can you launch it.
FYI: I have gone through these links already
'App not Installed' Error on Android
Application not installed when i try to autoupdate
My question is little different.
I released app with default/main activity as XActiivity.java in version 1.0
I released update with changing default/main activity as YActivity.java
I find that app opens fine from application meanu, but when I try to launch from home screen shortcut, it throws an error saying "Application is not installed"
I know that its due to shortcut referencing to old XActivity.java, by removing would solve this issue, but if I release app to thousands as an update who already have this app would get annoyed at the first instance of this error message. I would loose on good reviews I got
Please check if you have the property android:exported="false" on an activity that should have been a "android.intent.category.LAUNCHER". This disables the specific activity from being launched on the launcher.
in 2021,
just add
android:exported="true"
in the manifest, and it will be fixed
That is because homescreen shortcuts work slightly differently from the launcher icons in some launchers.
Your old shortcut still contains a reference to XActiivity as the main Activity, when you have updated it to be YActiivity. This causes Android to think the app isn't installed, as it cannot find an XActiivity in your app marked as the MAIN Activity.
Simply removing the home screen icon and adding it back will solve this.
Putting
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
inside specific activity inside Manifest.XML did the job for me.
This question is old, but still relevant today.
This occurred because I changed the starting activity. I had this originally (truncated):
<manifest>
<application>
<activity android:name=".activities.StartActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.OtherActivity"
android:exported="false" />
</application>
</manifest>
I removed StartActivity but I forgot to remove android:exported="false", after adding the intent filter. It looked like this:
<manifest>
<application>
<activity
android:name=".activities.OtherActivity"
android:exported="false"> <!-- REMOVE THIS -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
In short, make sure your starting activity is exported.
What if you implement both XActivity and YActivity as entry points in your app? XActivity could remove its launcher shortcut, install the YActivity shortcut, and launch YActivity.
first ensure if current installed apps can be moved to sd card
if they cant be that is it you have got the reason
on my htc desire 300 while rooting i flashed wrong rom bricked my phone in bootloop
got it repaired from a shop
now running custom rom i dont know which one
but it doesnt support moving app to sd card
so i copied app to phone memory
unmounted or removed sd card
then i try to install from phone memory and my fs2014 1.35 is now installed
horrray
hope it help you
this will only work if you have custom rom because original rom does nt have errors like that
or you call that a bug
Possible Solutions of “Application not Installed” error
Reboot the phone: In times like this, first thing to do is to reboot
your device. Or just shut down, remove and reinsert your battery.
Make sure to uninstall any apps you don’t use to free up space, also
uninstall previous versions of the same app currently installed on
your device.
Double check the apk files you download and be sure they were
completely copied or downloaded.
Try resetting app permissions by going to Settings >Apps>All>Menu key
Reset application permissions or Reset app preferences.
Change app installation location to Automatic or Let system decide.
Make sure your SD card is not mounted or connected to a PC or
elsewhere.
For worst case scenarios, format your SD card – copy it’s contents
somewhere else for backup and format.
The last solution would be to totally wipe your device. Either by
doing a factory reset under Settings or by doing a full wipe in
recovery mode.
Reference
I've had the same problem, just a minute ago.
I'm not expert so all I could get from all answers is problem is in shortcut created on home screen by launcher.
I'm using classic minimalist launcher which doesn't have app drawer so all apps are on home screen, so I can't just delete shortcut without uninstalling it.
So I cleared cache of my launcher and it created new shortcut for that app on its own and it started working.
Might be a case, check your code for "App shortcut creation" where the Intent.EXTRA_SHORTCUT_INTENT is mapped to the LAUNCHER activity. (Might be SplashScreenActivity)
The solution I wrote is.
AndroidManfest.xml
I retained intent filter android.intent.action.MAIN for my previous XActivity.java.
I also retained intent filter android.intent.action.MAIN and also category as LAUNCHER to YActivity.java
In the onCreate() method of XActivity.java I added these lines, and it seems to have solved issue
Intent thisIntent = getIntent();
if(thisIntent.getAction() == "android.intent.action.MAIN"){
Intent intent = new Intent(this,YActivity.class);
startActivity(intent);
finish();
}
I am trying to develop a setup wizard for Android, as I would like to add some functionality to the one existing from Google. Is it possible to somehow interact with the Android wizard? Because when I have searched for information I've seen that not using Google's Wizard might cause some trouble, regarding gmail account activation and so on.
If not, could an activity be called immediately before or after Google's wizard? Would it be enough to just listen to the BOOT_COMPLETED event?
Thank you very much in advance!
I don't know how you will use this unless you are making a rom and can add your app to system but basically you make your setupwizard add-on a Home activity with action MAIN, and categories HOME,DEFAULT. You should also set the priority higher than 1. If any of this is unclear you can look at the Launcher source/manifest that is publicly available.
When your activity is done it should deactivate itself with the PackageManager (setComponentEnabledSetting) and that should be it.
You can add additional activities that start the first time the phone is boot up. You just have to mimic the same behavior as Google's SetupWizardActivity.
Here's the relevant portion in the AndroidManifest.xml for reference:
<activity android:theme="#style/InvisibleNoTitle" android:label="#string/setup_wizard_title" android:name="SetupWizardActivity" android:excludeFromRecents="true" android:launchMode="singleTop" android:immersive="true">
<intent-filter android:priority="5">
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.DEVICE_INITIALIZATION_WIZARD" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
This will allow you to run your application before/after SetupWizardActivity, depending on your priority. I believe higher numbers for android:prioirity run first, but don't quote me on that.
You can find out the AndroidManifest xml for various Android-related apks using apktool. You can even inspect some of apks you picked up from the Play Store or whatever other sources.