On all Android devices,when I press the home button - android

In my program's any activity ,I press the home button,and then in desktop press my app's icon,I saw the launch activity,not before activity.What happen on my app?
And I found if I use Android Studio run without sign,the app is run normally.A month ago,I move the codes from eclipse to AS,on eclipse IDE not found this problem.Can anybody help me? Very thx.
Maybe grammar errors,sorry.
EDIT:I found this is an Android bug https://code.google.com/p/android/issues/detail?id=26658
And the solution is https://code.google.com/p/android/issues/detail?id=26658#c14

If you are working on real device, make sure you didn't set the flag
Don't keep activities in Developer options.
On emulator check in running configurations that you launch the default activity.
On manifest check that you do not exclude your activities from recent.

Related

How to start developing app for Google Glass?

I am working on a Google glass Android app. I have installed the glass development kit (GDK) in Android SDK. Now I created a glass project using Android Studio (Version 3.3.2). The newly created project is showing an error "Default Activity not found" in run->edit configuration.
Please refer the screenshot for the error.
1.
And 2. By clicking run->Edit Configuration in menu.
I have searched a lot on Google and found many articles regarding the same. All are suggested to set the edit configurations option like below.
Module: app
Package: Deploy default APK
Activity: Launch default Activity
Target Device: USB Device
I did the same, but no one is working for me. After spending the whole day to make it work, I came here. This error is due to the Launcher activity, because there is no launcher activity in Google glass project instead it uses Voice Trigger intent filter. It is similar to wearable apps they also don't have the launcher activity.
Android Studio won't let you use a standard run configuration without specifying a launcher in the manifest.
You could try using the gradle command line instead:
./gradlew installDebug
In case you haven't resolved the issue. I came across similar issue before, two ways worked for me:
Choose "Nothing" as the option. You will be able to run the app manually on the Glass, but your debugger won't work straight away. You have to manually attach the debugger to the process. You may also have to use logcat if there is a bug in the launching process.
Specify an activity (whichever is associated with voice trigger).
Also, I noticed that you created the app using Kotlin. Kotlin activity didn't work in my case, throwing exceptions associated with nullable var when resuming the activity. Non-activity classes worked fine. Please let me know if Kotlin activity worked in your case.

Force Stop Running Application Before Build in Android Studio

I know there is an option to "force stop running application before launching activity" (which I do have enabled) but I'm after a way to have the same program exit as soon as I click the "play" button. I believe this is what use to happen before an upgrade but ever since the upgrade I've been unable to find a way to do it.
The reason I'm after this is because before (when the app closed when I pressed the button) it was really easy to tell when the new edit of my app was up and running on the device. Now that the old version keeps running I frequently make mistakes thinking the new version is already running before it is, or more commonly, not realising the new version is ready thinking the version I am looking at is the old one.
Is there a way to bring back the behaviour I seem to remember having before?
Thanks.
You can disable Instant Run via Settings -> Build, Execution, Deployment in Android Studio
Disable the Instant Run option from Settings as follows:
I think check thd delendencues and any error code written in any java as well as manifest file of application . I have done and my app is running.

Custom Keyboard - Could not identify launch activity: Default Activity not found

I am following a tutorial on creating a custom keyboard for an Android device. I am using Android Studio 2.1.2. There is no activity in the program because you have to activate the keyboard in the language & input settings.
When I run the program I get this error: "Could not identify launch activity: Default Activity not found
Error while Launching activity"
I have posted on the site but have gotten no response. I followed the tutorial step by step and looked it over for a couple of days. I am new to Android Studio and Android applications and was wondering if anyone knew how to help me.
This is the link to the site I am following: http://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615
I just figured out what needed to be done.
You have to edit the configurations and change the launch option to "nothing". This way it won't try to launch and activity that does not exist.
run->edit configurations then look for the launch options
Well you have answered it by yourself.
If you are creating an keyboard application(inputmethod) in android, everytime you compile and run your applcation, it will show a warning that there is no default activity since it's InputMethodService, the service. Even you add activity like some settings activity for your keyboard, it will still show you warnings and it's the normal operation.

android app is unable to debug in eclipse

I am trying to debug my android app in eclipse but I am not able to do so.
I know this question is asked many time. I have try almost all things but still cant debug my app.
I have android:debuggable="true" in AndroidManiefest.xml as well as having Category launcher and action main in Android AndroidManiefest.
Kindly Help me.
Thanks in advance.
I resolved a very similar problem by using the DDMS perspective. Once in DDMS, I would start my application on my device. I then selected my application process and clicked the "Debug selected process" button.
Restore to defaults in Run/Debug options.

on click of shortcut on homescreen launching from spalsh screen in android

I reated configuration in mainfest file as follows
shortcut is created on homescreen, but the problem is when i click on this it is not retaining the state correctly, it is starting from splash screen. when i launch an app from all apps it is retaining the state correctly.
Myapp-->splashscreen-->Activity1-->Activity2-->click home-->click shortcuticon-->splashscreen
Myapp-->splashscreen-->Activity1-->Activity2-->click home-->-->click menu-->all apps-->click shortcuticon-->Activity2
I'm going to assume that you started the app initially (the first time) from an IDE (like Eclipse or IntelliJ) or after installing it using the installer (from the market or browser or clicking on APK in file browser). If so, this is a known bug in Android (see http://code.google.com/p/android/issues/detail?id=26658 ). Many people have struggled for days chasing this problem :-(
A simple workaround for this problem can be found at http://code.google.com/p/android/issues/detail?id=2373#c21
To verify this is your problem, don't start it from the IDE or installer. Simply install the app and then go start it from the list of available applications.
If the shortcut is created programmatically then your app wont resume because you have specified an activity for shortcut intent,
To solve this, have a look at the the answer here

Categories

Resources