Android :: Current Activity Force Closes - Tries To Go To Previous Activity
Nov 5, 2010
The default behavior from my observation is if current activity force closes Android tries to go to previous activity on stack How can I control this behavior? I want force close to close all activities
View 2 Replies
Apr 27, 2010
How to finish any previous activity in application stack (at any level , I mean not immediate parent) , from current activity like on some particular event I want to invalidate this previous activity?
View 1 Replies
View Related
Aug 26, 2010
how to get font from the previous activity on current activity on canvas
View 1 Replies
View Related
Nov 19, 2010
I'm trying to bring up the standard window for Bluetooth Settings (with Device name, Discoverability etc). However, general approach with startActivity(intent) ends with NullPointerException pointing to BluetoothSettings.java onCreate:135. Checking with the Android code, I've found that at line 135 they get some extras from the intent. So I prepare the same extras (names I've found in android core BluetoothDevicePicker interface) and issue it -- the same effect with NullPointerException. Might be the wrongs names of the extras I prepare? So is there a way I can see those extras (with names especially) from the intent the system itself submits when I open Bluetooth Settings manually acting like a user. Code...
View 1 Replies
View Related
Dec 30, 2009
I am developing an application in which the user require to register first and than got the user page. For that i have made layout and the layout consist many fields, so, i have made part of layout and also made the separate activity for the each layout. The layout like address, phone, etc... After that i have wrote the code for calling an activity and it works fine. It means when i press the "Next" button the another page will come and it will also consist some textview ,edittext and previous and next button. Actually, i want something different like -- When the user fill the first form and he will proceed to next, the content written by the user should not gone when the user press "Next" button. The content should be there which was written by user. And same way i have have 6 pages like that way to complete the registration process. So, have you any idea to solve above problem? I really need your help because right now i stuck at this point. So, please any body help me out of this problem. I would appreciate your help. I am waiting for your reply.
View 15 Replies
View Related
Aug 27, 2010
My app is comprised of a set of reusable Activities that other apps can reuse. For various reasons, I would like my Activities to be launched in context of the invoking Activity's process, instead of always being launched in my Activity's process (default behavior on Android). How can I achieve this?
View 1 Replies
View Related
Jul 16, 2010
I used Toast to make notification, but it seems it will appear even its activity is not in the current screen and some other activity has been started.I want to check this situation, when the activity is not the current one, I'd not send the Toast notification. But how to do ?
View 1 Replies
View Related
May 1, 2010
I have following problem with my application: From my main activity ("activity 1"), there is a menu from which user can launch an action. This action will result in an Intent being received by a BroadcastReceiver, defined in my application. Finally, this BroadcastReceiver will start an activity ("activity 2") to deal with this intent.
The problem is that I have a "quit application" entry in my menu, and I can only finish() currently active activity. ie I am not able to finish "activity 1" from the menu of "activity 2". And I can't use startActivityForResult() as "activity 2" can't be started from "activity 1". Any suggestion would be much appreciated Thank you very much guys, regards.
View 4 Replies
View Related
Oct 2, 2009
startActivity() displays the new Activity on top of the current one. But how to display it underneath instead? BTW, I'm starting an Activity from another application, if that makes a difference.
View 5 Replies
View Related
Aug 21, 2009
I have a problem to start/create Activity in landscape mode. My Activity need to start in landscape mode and be used in landscape mode by users. So far, I used setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) to force screen orientation of my Activity to landscape mode in onCreate() method.
In addition to this screen mode requirement, my application need to start another background thread in onResume() method, and this thread takes some seconds in order to finish an initialization process, and it is not desirable to to stop/restart this thread's service during the initialization process.
However setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) forces my Activity restart in a very little while (means onCreate->onResume->onPause->onStop are executed twice at the first place). As a result, my background thread be stopped/restarted during the initialization process, and this makes me a mess at this moment.
View 3 Replies
View Related
Jul 29, 2010
Is it possible to add an activity on top of the current activity.
For example lets say i click a button, and then it adds a second activity to the current activity. And the second activity only covers a small place at the bottom of my current activity.
View 3 Replies
View Related
May 13, 2010
The default behavior of an activity when BACK softkey is pressed is, GO BACK TO PREVIOUS ACTIVITY. If some the same activity is waiting for some response from server or some data updation is going on and then press BACK, I want to wait on the same screen till the current task is completely processed and then move out to the previous activity.
You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options
View 12 Replies
View Related
Jul 24, 2009
This is an intermittent bug in one of my apps. I don't expect anyone to solve it immediately, but I'd appreciate any thoughts on how to start debugging!So, my app lets users edit an item (in the EditPage activity). When they press the Back key, the desired behaviour is that it saves their edits and returns them to the home page (the HomeList activity). The code for this is below. It works fine. Except.The bug is this. Some users report that sometimes when they reopen the application after a pause, they are seeing *not* the home page, where they left the application - but the previous edit activity. Crucially, they are also seeing the edit activity without their saved edits - effectively losing their most recent edits.I've been able to reproduce this myself. It only happens after the application hasn't been opened for a while. If I save something, minimize the application and reopen it straight away, it shows the HomeList activity just fine, and the edits have all been saved. But if I save something, leave it for a couple of hours and then reopen it, it shows the previous EditPage activity, without the saved edits (i.e. in the state that the EditPage activity was previously launched).
Any ideas, anyone? I had wondered whether it was due to the Back button being used to return the user to the HomeList activity - maybe Android thinks that the Back button means that the HomeList is not the most "recent" activity, instead the EditPage is. I'd like to carry on using the Back button if possible, though. And in particular, I'm puzzled why it only happens after the app has been idle for an hour or so, and not immediately? Is it something to do with Android's memory management?
View 4 Replies
View Related
Jun 2, 2010
I need a way to detect if this is the first time the user is ever opening the application, if so, start an activity. Then all previous application launches wouldn't start that activity. I've read in a few places about using preferences to accomplish this. Anyone got any ideas?
View 2 Replies
View Related
Feb 16, 2010
Can anyone tell me how to stop media player that was started in a previous activity?For ex. In activity-1 button pressed that did - mp.start(); then activity-2 starts for different layout with new buttons, then when button pressed, mp.stop is called, but does not stop the media from the first activity.
View 4 Replies
View Related
Dec 16, 2009
How to store previous activity value in android
View 2 Replies
View Related
Jul 14, 2009
Can any one tell me how to pass the value from one screen to its previous screen. Consider the case.i m having two screen first screen with one Textview and button and the second activity have one edittext and button. If i click the first button then it has to move to second activity and here user has to type something in the textbox. If he press the button from the second screen then the values from the textbox should move to the first activity and that should be displayed in the first activity textview.
View 4 Replies
View Related
Jul 4, 2010
I have two activities. The first is a list where the user selects one of the items which takes them to a second activity showing the details of the item they selected. When the user clicks the back button I want the app to return to the first activity.
Is there anything special i need to do to make this happen?
Right now when I click the back button from the second activity it exits the app just like the home button would.
Here is how I am starting the Second Activity. startActivity(new Intent(getApplication(), SecondActivity.class)); finish();
View 3 Replies
View Related
Oct 31, 2010
I'm writing a bitmap editor and I'm trying to write an autosave feature. When onPause is called, I write the application state to an autosave file. As this takes between 0.1s and 1.5s, I've been advised this IO operation be performed in a background thread.
In the onCreate method of my activity, I check to see if the autosave file exists and, if it does, I open it.
Are there any scenarios I have to consider where the user can somehow leave the activity, the autosave thread starts and the user can return to the activity before the thread has finished? If so, how can I detect this and wait for the thread to finish before I check the state of the autosave file?
I was going to make it that, when the user backs out of my activity, they're asked to wait a second while the data is saved. This seems OK, but I can't do this when my activity is interrupted by something like a phone call.
Also, I'm a bit confused about how multiple versions of the same activity can be started as this makes dealing with autosaving more complex. Is there a way to make sure only one instance of my activity is allowed to run at a time?
View 2 Replies
View Related
Apr 20, 2010
I am using an Application object to store app-wide instance data--data that I need to remain in existence for the entire lifetime of the app, so the Application class seems like the proper place to put it. I have just finished reading this thread http://groups.google.com/group/android-developers/browse_thread/threa... that goes into pretty good detail and receives confirmation from Googler hackbod as to how the Application class performs--and from that info it seems this strange behavior I am receiving should not be happening...
Basically, every once in a while when I resume my app in any of its Activities (it is still running in memory so onCreate is not called) I get NullPointerExceptions because instance variables in my Application class are returning null when I request them from my Activity (via a getter method in my custom Application class). It seems as if sometimes Android saves the states of my Activities but deletes all my instance variable data... This can't be an Android problem--there must be something wrong with my code.
Has anyone else ever ran into an issue of this kind? Any ideas as to what may be causing this? I'm not going to post my code here as that won't help anyone, but hopefully someone can point me in some helpful directions.
View 11 Replies
View Related
Apr 21, 2010
I'm writing an application consisting of several activities and, on restarts, I'd like the application to initially display the application's activity that was the last to display in the application's previous session.
I save information about the last activity in SharedPreferences and I'm trying to start that last activity with a call to startActivity(intent) from my Application's onCreate handler.
The problem is that if I don't set the intent's FLAG_ACTIVITY_NEW_TASK, the result is a run-time exception message in logcat suggesting that I should set the flag. And if I set that intent flag, the correct activity gets started but doesn't fully initialize resulting in null pointer exceptions (which don't occur when I don't attempt to start the activity from my Application class).
CODE:...........
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
How to correctly start a particular activity from the Application class's onCreate handler?
View 3 Replies
View Related
Jul 15, 2010
When i leave my app after pressing home button and then re launch it from menus it behaves in a strange way.Sometimes it launches the same activity on which i pressed home button.But sometimes it launches the first activity of my app. One reason for this could be that whenever system has memory shortage it clears any activities existing in But the strange thing is if i press back button from first activity it takes me back to the same activity on which i pressed home button and all other previous activities are also there(like if i press back button again previous activities also exist.)I haven't set any launching mode for any activity in my app(like single instance etc).What i don't need is that previous activities load on pressing back button on first activity.
View 2 Replies
View Related
Oct 26, 2009
I have an android application with a LOT of activities, think of something like a book where every page is a new activity. The user can make changes in each activity, for example highlight certain texts with different colored markers etc. and it's crucial that I'll remember this information as long as the application stays alive (and I don't want/need to remember any of this when it's not). As I understand the best mechanism for storing this kind of information is via onSaveInstanceState(Bundle outState) and onCreate(Bundle)/onRestoreInstanceState(Bundle) rather than lets say, the Preferences mechanism. My only problem is that the user can navigate backwards to previous pages (Activities) and the only way i know of achieving this is by calling finish() which of course kills the current activity without calling onSaveInstanceState(Bundle outState) and even if it did call it, the next time I would launch an activity representing that page it would be an entirely new instance. So my question is: Is there a way to go back to the previous activity without calling finish()? or, is there a better way to save this information? maybe through static variables?
View 1 Replies
View Related
Nov 3, 2010
Im wanting to stop all threads when my main activity closes as some are still running afterwards and are giving NullPointerException as they try to access Array Lists which no longer exist. however none of the obvious methods are working and they are also deprecated. is it possible as im currently using a try/catch statement as a workaround but would prefer a fix.
View 1 Replies
View Related
Oct 29, 2010
Can anybody tell me what method of an activity executes when an application closes?. Like I have a main activity and if I press back button on my phone. The Application closes so I want to know what method executes at that time.
View 1 Replies
View Related
Aug 11, 2010
I have Serviceļ¼Sometimes current run Activity work in background I don't want to know. I want to know current work interface Activity name?
View 3 Replies
View Related
Oct 19, 2010
How can I know what Activity has started the current Activity? Is there any specific method like, i.e. getIntent().getCallerActivity() or the only way is saving some information within the Intent using putExtra()?
View 1 Replies
View Related
Apr 9, 2009
Is it possible to get the currently running activity through Service..?
i.e. I have a service started by an Activity A, and now I want to stop the service by another activty say Activity B.
Since Activity B doesnt know about the service, i want to capture the events in OnKeyDown() of the Activity B in my service...
Is this possible.. How can i get the Activity B's object..?
View 6 Replies
View Related
May 17, 2010
I am trying to make a task switcher and i succed in it. My only problem is that when I launch activities, they are relaunched as they were new activities ( for instance, I am writing an email, i press home and go into my activity,launch email, and then the app launch the email bout goes back at the inbox and the email is lost) So that's not true multitasking.
View 2 Replies
View Related
Jun 11, 2009
Is there a function that allows me to get the top most view (the root)?
View 2 Replies
View Related