Open app when home button preseed in android [closed] - android

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
When I press home button in android phone
at ant time open my application
How I Do it, Please ???
And How I Exit from app (not go to the last Activity)

Overriding the Home Button is not a recommended thing to do. The Home Button serves as a panic/safe button for the user whenever something goes out of hand. Overriding the Home Button will present issues if you make it open another application.
You can override it to open another application, however, the Android OS will ask the user to choose between the default home button application (the one that brings you back to the home page of the device) or your application. At this moment, the user can set a default application to go to. If I'm not mistaken, it will take root access to completely override the home button in such a way that the above mentioned process of choosing a default application.

Related

Android call activity integration inside chat interface [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have an android VOIP app which works as follows.
Summary of the app-
The app once launched scans the WiFi to look for other android devices who have my app installed. (Note: The devices having my app installed should be connected to the same WiFi network).
Once the scan completes, it lists all the available devices. The user can click on any device and initiate call or chat.
After clicking on the user, an action dialog appears containing a positive button and a negative button. That is, positive button = call and
negative button = chat.
Each button opens their respective interfaces when clicked.
My question is...
a. How can I integrate the call button inside the chat interface?
For example, I could make a toolbar and attach the call button to it.
Any help is appreciated. Let me know if you guys have any queries.
The call button, that is on top in the example image given, is a normal ActionBar MenuItem.
A good start to know more about Menus is the Android Developer Guide website: Menus

How to make intro activity appering only once? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I just created intro sample show some tips in my app with 3 fragments and it works well but it only appears to user when I made the intro activity in manifest as "launcher" activity. So it appears every time the user opens the app.
What I need is how to make this activity appears only the first time opening the app?
You can use SharedPreferences and set value in that when User will open it for the first time. after that Every time user open the App you can check that variable. If that value is set then you can directly call next Activity.
But for this approach you have to make that <activity> with attribute android:noHistory="true". then It will work.
You can set an activity before your intro and using SharedPrefereces you can store when user open your app for the first time. In the case that is the first time you start the example activity else you start the main activity.
You can save just a boolean value SharedPreferences

Why some of the android applications include "Press Back again to quit" feature [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have seen a lot of Android applications recently that they display a Toast saying "Press Back again to quit" when back pressed.
We can implement this feature easily just by keeping a boolean when back pressed. But is there any specific reason to implement this feature ??
But is there any specific reason to implement this feature ?
IMHO, no.
I have seen two use cases for this in apps that I have used:
The app has important UI down by where the BACK button may be, and they are worried that users will accidentally tap the BACK button. I would recommend they not put important small tap targets down there in the first place.
The app is using BACK to mean something other than "return to the previous UI state", like a file manager using BACK to navigate up a directory tree. IMHO, that's a mis-use of the BACK button.
Yes, should be pretty obvious, for example you would implement this if you don't want your user to accidentally exit the app. If the navigation hierarchy of your app is big enough there is a significant chance that the user presses back one too many times. Such a feature is a simple fix for that. Although I wouldn't recommend it if it is not really necessary for your app since such a feature can also be annoying pretty quickly...

android press home button and re-enter my application [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
In my app, my own Application class saved some static variables, after clicked home button in my application, the screen go back to home. now i want to resume my application, when i click my app icon in launcher, the variables of the variables before are null, but onlongclick home button and choose my application, the variables is normal~
When you click app icon from the launcher at that time second instance generated for your app.To solve this issue you have to manage with single instance. For that you can use
android:launchMode="singleTask" or
android:launchMode="singleInstance"
` in your manifest for activity
Refer this question too

My app closes when screen turns off [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I got a problem with my app when the screen turns off (because of system screen timeout) my application finishes.
I search but didn't find something helpful.
Is it a common problem or does it have a fix?
you shud not call finish() in onPause. it could be called for variety of reasons(check doc.). why you want to kill your activity when user switches app? its not recommended.
here are some posts, but there is no api available to detect app going in background.
How to detect when an Android app goes to the background and come back to the foreground
http://nathanael.hevenet.com/android-dev-detecting-when-your-app-is-in-the-background-across-activities/
I want when the user leaves this activity to finish but not the screen thnx
Take finish() out of onPause(). Put it wherever the user leaves the Activity. So, assuming you have code that starts a new Activity, put finish() after startActivity().
You also could use the flag android:noHistory in your <activity> tag of your maifest.xml so that the Activity is removed from the stack whenever it starts a new Activity. Both of these methods do the same job it just depends on how you want/need to implement it.
The reason it closes when the screen turns off is because your app calls onPause() at that time so removing the call from that method would keep it from closing when the screen turns off.

Categories

Resources