Android :: Difference Between A Dialog Being Dismissed Or Canceled ?
Jun 26, 2010What is the difference between a dialog being dismissed or canceled in Android?
View 1 RepliesWhat is the difference between a dialog being dismissed or canceled in Android?
View 1 RepliesI have an Android Spinner and I'd like to get a callback when the user selects something from its popup dialog. It seems like
setOnItemClickListener() or setOnItemSelectedListener()
would be the right method to use, but neither get invoked when I select one of the items in the spinner. Is there a correct way to do this? Per commonsware's suggestion, I did the following, but my onItemSelected() method is never being called:
final Spinner spinner = (Spinner) findViewById(R.id.spinner);
spinner.setAdapter( new ArrayAdapter<SettingValue>(getContext(), android.R.layout.simple_list_item_1, android.R.id.text1, setting.getSettingValues() ) );
spinner.setOnItemSelectedListener( new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Log.d("BOOGA");
final SettingValue settingValue = (SettingValue)parent.getSelectedItem();
final Editor edit = getContext().getSharedPreferences( PREFS_CONTEXT_NAME, Context.MODE_PRIVATE).edit();
edit.putString(setting.name(), settingValue.name());
edit.commit();
} public void onNothingSelected(AdapterView<?> parent) { // do nothing
} } );
Look at my code.
- code -
private Handler handler = new Handler(); private ProgressDialog dialog;
final Runnable runInUIThread = new Runnable() { public void run() { dialog.dismiss();
} };
private void DoThis() {
dialog = new ProgressDialog(Main.this); dialog.setTitle("Title");
dialog.setMessage("Text"); dialog.show();
Thread newTask = new Thread() {
@Override public void run() { Looper.prepare(); DoThat();
handler.post(runInUIThread); Looper.loop();
); newTask.start(); } }
Is it possible to use test.setText("something") in this thread to update a Button text or TextView in the LinearLayout after the dialog is dismissed? I try cheating placing:
test.setVisibility(View.INVISIBLE);
test.setText("something");
test.setVisibility(View.VISIBLE);
after dialog.show();
It kind of updated the text when the dialog open. I want to do it after the dialog was dismissed. What is the correct way to implement this in my thread?
I've created a custom PopupWindow but when I press back button, the window doesn't dissapear.
View 3 Replies View RelatedThere are many questions related to how to programatically show/hide the soft keyboard.
However, as we all know the android back button will cause the keyboard to be dismissed. Is there a way to prevent the user from dismissing the keyboard with a back button press?
I tried to capture the back button, but when the keyboard is displayed onKeyDown in my activity is not invoked when the back key is pressed and soft keyboard is visible.
Why launch is canceled in android
CODE:.........................
I have an app that does some polling every 2 hours. I set a repeating alarm that starts a service but I have noticed that if I use some task manager (e.g. TasKiller) to kill my app then the polling will not be performed from that moment on. I know this because I store the time of the last poll, I have also checked the server logs and there are no requests received from the client after I force close my app. Is this the way alarms work or should I look somewhere else for a crash or smth? because if alarms really get canceled then how should we implement the polling?
I'm also interested in what happens with a running service if it gets killed from another app (I assume all task managers are using ActivityManager.restartPackage() to kill other apps), does it get restarted?
I have two BroadcastReceiver registered. When the app is closed they both fire at the appropriate times and do the appropriate things. If the app is closed then killed (say with an AppKiller), the receivers never receive their broadcasts, and nothing happens. Presumably the same thing happens if the parent app is killed due to low memory, so how do I ensure those broadcasts are fired/received. The API states that even if the app is killed it should fire, does anyone else have experience with this situation? If it helps my manifest is:
<!-- receivers for AlarmManager -->
<receiver android:exported="true" android:label="Shift roster updating calendar."
android:name="com.skooter.shiftroster.backend.service.UpdateCalendar" >
</receiver> <receiver android:exported="true" android:label="Shift roster checking alarm."
android:name="com.skooter.shiftroster.backend.service.SetWakeup" >
</receiver>
and nothing esoteric is going on in the AlarmManager/BroadcastReceivers
Since purchasing the DI, have you canceled your land line? I did on Friday. Had my DI for 2 weeks, works fine, voice quality OK
View 49 Replies View RelatedI had a message for the update from 3g i pressed cancel now i dont know how to update.
View 3 Replies View RelatedI've experienced the following problems in 2.1 and had hoped that it would be rectified in 2.2. FYI I'm using a UK unbranded SIM free SGS and the stock alarm with the smart alarm feature turned on. When I set the alarm for the morning and then cancel it later on (e.g. I wake up naturally an hour before the alarm) I find that despite canceling it the alarm still goes off at the initially set time.
First of all, I was simply unchecking the green alarm symbol in the "clock" application. Then as this was failing to cancel it, I would long press the set alarm time until the option delete would appear and completely deleting the time altogether, yet the alarm still goes off. I have also noticed in 2.2 that the alarm date does not seem to be as intuitive as it was before. Previously I recall setting the alarm the night before by scrolling the time forward past midnight to the morning and the day would follow suit.
However, a couple of time that I have used the alarm the alarm has tried to enable itself for the same day as being set. However, as the clock is being scrolled forward this would often show as time to alarm 6+ days and hours. Don't recall seeing that on 2.1? Finally, is there a dedicated place where more smart alarms can be downloaded and incorporated into the smart alarm feature? I know of Zedge, White Noise and others but most are not true smart alarm sounds. Often just screen shots or clips of noises, which do not segway nicely into the start of the alarm loop when the track has completed.
I has a galaxy 4 like 2 month with my micro sd of san disk 16gb class 4 it work perfect for me and I decide to purchase a 64gb from ebay I bought a samsung card 64gb class 10..and now start the problem.
I insert the card to phone and it ask me to format it..I did it and after format I see in available free storage is 0.0 I take it out and format in comuter to fat32 ensure that is writeable and put it my phone I can see the card and I can see what have in it but when I try to move/copy some thing to the card from phone its give me a pop up message "the move/copy canceled"
So I take it out and put on my tablet and its work perfectly.
I have a dialog with edittext for input. when i click yes button on dialog, it will validate the input and then close dialog. However, if the input is wrong, i want to remain in the same dialog. every time no matter what input it is, the dialog always automatically close when i click button. How can i disable this. By the way, i use PositiveButton and NegativeButton for the button on dialog
View 2 Replies View RelatedI ordered password manager for dolphin browser HD2, they pulled back the app refunded my money and said this,"Thank you for using Google Checkout. In an ongoing effort to provide a safe purchasing environment, Google reviews orders on a regular basis.For your security, we've cancelled the following order" "Google Checkout no longer processes orders for this merchant. If you'd still like to make a purchase from Dolphin Browser Add-ons, please contact this merchant directly or feel free to retry your order with another merchant" Has anyone else experienced this? Anyone have a better explanation than the canned response from Google's legal team.
View 6 Replies View RelatedWell as implied by the Message Google killed the primary email adress on my Brother inlaws phone. We Know our options but were wondering if there was a way for you to get rid of your primary Gmail without having to data factory reset. He wants to not lose all of his Apps and all that. If there is No way to do this besides wait on Google to get back to him then I have ways of getting him Mostly back. Just curious for some ideas.... Has anyone evef heard about goggle shuttin down anemail withnout probable cause?
View 11 Replies View RelatedSince I upgraded to 2.1 (nordic) my alarms on maths alarm clock have been canceled twice making me late for work!
It just wipes all the settings, I thinks it's something to do with charging anyone had similar problems?
My device is LG KU3700 (Lg optimus one p500)
When I try to USSD (checking my balance etc.) it shows MMI code canceled.
I did Upgrade my firmware 2.2.2 into 2.3.4 but it wasn't solve.
I am having a problem about repeating Login dialog (an AlertDialog) and progress dialog, coordinating with http thread. I suppose repetitive Login dialog (if fail, continue) handling should be common and straightforward. I guess my approach must be wrong somewhere. I already spent 2 days on this and am desperate. So please help. User starts the app, the main activity starts.Show a login dialog (generated by the main thread, i.e. from on Create. The main thread then starts a wait_thread, which will wait for http to return data and check the data and decide what to do.After user input username/password and press login, a progress dialog starts.The progress dialog starts an http_thread to talk to the server and get replies. Once done, it will notify the waiting thread.If the user type in the right username password first time, the code works fine.But it always fail for 2nd time Login, i.e. When first login fail(wrong username/ password),the wait_thread will generate 2nd Login dialog to let user repeat the login process. But after user hit the login on this 2nd Login dialog, the system always crashes.
View 3 Replies View RelatedI want to make a custom Dialog,because i donot like it"s style,i want get a rounded rectangle rather than rectangle . i know to implement it by theme in Manifest.xml . for example :the code
at activity write:
CODE:............
My question is how to implement this Similar result by extends dialog or alertDialog.
I'm trying to get my list view to open up an alert dialog to display information when a person clicks on a selection. I have been trying several different things on the Google Developers website that have to do with this but have yet to come up with a result. Here is my code. package table.periodic;
import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.AdapterView.OnItemClickListener;...........
how to create an Alert dialog in a dialog? is it possible to create? My requirement is to show mulitple dialogs simultaneously. I tried creating with the following code snippet onClick of a Button in the first Dialog and got an "BadToken" exception from WindowManager: "Unable to add window -- token null is not for an application"
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle("Test Title"); builder.setOnCancelListener(new Dialog.OnCancelListener() { public void onCancel(DialogInterface dialog) { dismiss(); } });
I have a really weird problem, which I am unable to debug so far. thing is. my app needs to download something to work. So in the beginning of the onCreate() method, I check if that something is already downloaded. If not, I pop a dialog up asking the user to download it.My dialog is shown and I am clicking, so aManager.install() is called. I am passing the context because that aManager.install() pops up a ProgressDialog to show downloading progress and spawns a new thread in which everything is downloaded. So obviously before creating my dialog I make a Handler to receive the response from that aManager.install(). And the response MAY vary, because for example the internet connection isn't available (Exception raised and catched and listener called with different code).Now, when that happens (Exception) I would like to call another dialog saying "something went wrong, would you like to retry?" so another call to showDialog(DIALOG_REINSTALL) (this time with another code).thing is the showDialog() gets called (I can verify this by logging) but the dialogs doesn't show up. Instead my application JUST HANGS Does someone have a clue why it's doing this? No exception raised, absolutely nothing from logcat, I can't tell WHERE it's hanging...just see that the method is called and the dialog should be displayed.
View 2 Replies View RelatedI am trying to run example of facebook android sdk , in that i have run stream example to fetch the
data from facebook. Now hen ever i click on "fconnect" button to log in into facebook i am getting following dialog box. so is it possible to replace this dialog box with following to make it simple ?
I don't know how to position the progress dialog(the one with the rotating image). When my application starts its display an full screen image and a progress dialog box. I need to moved the progress dialog box a little lower.
View 1 Replies View RelatedI am New to the android ,what is the difference between android sdk 1.5 and android sdk 2.0
View 3 Replies View RelatedIf so what is it, and which one is made accessible by Android being open source? (Yup, I'm a newbie.)
View 7 Replies View RelatedCan anyone tell what is the difference between px, dip, dp and sp in android?
View 2 Replies View RelatedIn android build environment, what is the difference between 'mmm' and 'mm' command?
View 2 Replies View RelatedIs there a difference between the one that came loaded on the phone and the app in Android Market?
View 1 Replies View Relatedwhat is the scenario that makes me to pick between startActivity and startSubActivity
View 2 Replies View Related