I have a Activity called main. If I call Toast.makeText(this, "Hello World from main", Toast.LENGTH_SHORT); this works fine. However, for every other activity in my application, I cannot display a Toast. No exception, nothing in the Log but I don't see the Toast. Code...
Ok, I've tried two examples of AlarmManager- one from the commonsware website, and one from the manning website. The code I am currently working with is from the manning website : [http://unlocking-android.googlecode.com/svn/chapter8/trunk/SimpleAlarm/] There are two classes, AlarmReceiver and GenerateAlarm. Anyone have any idea why the toast will not display in the emulator? I was thinking that it was because I am located in the Eastern Time Zone and it uses UTC, but I have fiddled with different things and none of them seem to work.
I have an IntentService that handles button callbacks from a widget. When the user presses a certain button, I want to display a Toast. I return from onHandleIntent almost immediately after doing Toast.show(), which in turn stops the service and kills its thread, which keeps the Toast from actually being displayed.
Can anyone suggest an easy way to get the Toast (or something similar) to display from an IntentService?
I looked for any information about onTap event processing for itemized overlays in this group. There is a lot of useful information but I could not find the answer to one question.
The tutorial by Mark Murphy on itemized overlays, http://androidguys.com/?p=1413
describes how to generate a Toast message whenever an onTap event occurs. In his case, the custom itemized overlay activity is included in the main activity. In my case, it is not. My custom itemized overlay activity is included in the application package as a public activity.
This means that the line Toast.makeText(NooYawk.this, items.get(i).getSnippet(), Toast.LENGTH_SHORT).show(); will not work "as is".
I have had trouble in correctly identifying the context for the Toast. Attempts to use the main class' (the one calling the custom itemized overlay class) context have not worked. I would appreciate it if anyone could suggest how I could resolve this issue. Incorporating the custom itemized overlay class in the main class is not a desirable option.
Alternatively, I would appreciate any suggestions for generating a display of the title and/or snippet information for markers on a map.
The onTap event works fine (Log.i statements in the onTap method display the correct information for each marker tapped)
I am writing my own SMS application that will display a toast of my message once it arrive. Now is it possible to delete the message after the display of the toast, so that it will not go into the native SMS application?
I want to show a simple toast, when exiting an application. The problem is, that the toast is not shown. I assume it is because the acitivity is finished or because of System.exit(0), but I don't know how to solve it. Does anyone have a tip?
I am currently working on my first app which grabs a ZIP from the internet and the extracts it to a certain location. Everything works great but I can not figure out how to show a Toast message when the extraction operation is done.
I have tab bar in my application .In this I have three tab .it will call three activity .in activity i have the list view .if i click the list view it will call different activity other than tab activity.can anybody tell how to display tab bar for other activity give example?
I am wrting an android application which displays some buttons dynamically in a linear layout with vertical orientation.When ever we click on any button a new activity should start in the same frame . How can this be possible ? can anyone help me in solving this issue.I will be waiting for reply.
I am trying to make a app with the tuotrail of the developerspage, then I would like to display a main.xml in a tabview, instead the textview, wich in the tuotrail,is in the activity.How do I tell my tab in activity do display the main.xml?
I am new to android.I have a list view in one activity. Displaying data in it... I want to use another activity as a tab-bar for 1st activity which allow user to switch to other activity... Is there any way so that 2 different views can be displayed in 1 activity. And then how can i start a new activity inside this activity. Like when user click on any button in tab-bar the corresponding activity should be start but we should not Re-initiate tab-bar view...
I was wondering if there is a way to show a widget that I have created inside an activity. I have a weather widget and I also have an app I am working on that I would like to include weather reports in. Is there a way I can just re-use the widget code and make it show inside the weather activity?
I'm making an application that contains button's and those buttons control an embedded browser. My problem is that I want to see the button's and the web page in the same layout, but when i click on a button this will open a web page and don't show the button.
I'm just starting with Android and can't find how to display a list in my activity. The activity and the layout main.xml are shown below. How can I display the country array in the ListView 'list' of my layout?
How can I disable the keyguard when a broadcast receiver is activated by screen_on, so that when it occurs the user sees an activity that I have started behind it?(The activity is running already)I have been trying the following code from a broadcast receiver triggered by screen off.It doesn't seem to be working though as it is. When I turn the screen on, I still have to manually unlock the keyguard on the phone to reveal the activity behind it.
In my Project I want to play audio files in mediaplayer and displays progressbar. If I exit the application then also player have to play audio file. If I restart The Activity I have to display progress bar with last activity progress.
Here I tried using onSaveInstanceState() method. But I cant display progress bar with last progress. when I exit the activity player is playing but when I restart activity it stopped and displayed new view without any progress and saved data.
This may be a simple question but i am a beginner ,i need your suggestion on this. i have two Activities A1 and A2 .When i click the image on A1 screen i have to display progress bar until A2 screen appears(A2 activity has huge task to do).
This couldn't display progress bar .I know that i am making a mistake but i couldn't figure out.
I have problem when i start activity from incoming call broadcastReciever, the problem is :
when call is coming i start activity X with FLAG_ACTIVITY_NEW_TASK flag, and it is work fine when my application is not on the screen.
but if my application on the screen (activity Y) and call come, when activity X called from braodcastReciver Activity Y cover screen over incoming call screen then Activity X display, so 2 activity become over incoming call, although i just want activity X just display.
I use the following code to pop up the soft input keyboard in my Activity InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.getInputMethodList(); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); This displays the alphabetic keyboard. But I want to display the numeric keyboard. Please note I know that using setInputType() works when used with an Edittext or a TextView but I want to be able to display the keyboard without an input area such as an Edit Text and simply listen to the key presses on the keyboard. Can anyone confirm whether this is possible and if so how can it be achieved?
I have an android background Service that will occasionally post a notification to the Status Bar using the Notification class. Occasionally, when I receive a notification, pull-down the notification window, and select the notification from the list, the specified Activity doesn't start. When this happens, the screen dims (as if it were about to display the Activity), but the Activity is never shown. I included my code below...
NOTE: The UserNotification class extends Activity, and is set to a dialog theme in the manifest. This class also has its taskAffinity property set to "" in the manifest.
I want to have multiple listviews in single activity. But only one listview should be displayed at one time. The listviews will be loaded dynamically. So, how can I fill all the four listviews at the same time and display only one.
If anyone knows the solution then please share it over here. I hope to get a quick response.
I am just getting started with the Android SDK and I had a quick question. I am trying to set up a ListView with a rectangle of color on the left and then a bit of text for each row. I also want to make it so I can click each entry in the list and open a new activity to display some information (similar to the contact list).
I am trying to display a dialog box in a simple Java class that is called from my main Activity but not successful. Please help me to figure it out.
I am passing the required values as parametrs.
I have two class: class MainActivity extends Activity :: Main *starting point *of Application class ShowMyDialog :: a simple java program In which I *generate an URl* and *display a dialog with WebView*.
I am passing the Acitivity from my MainActivity to this class as a parameter in function.
But I am *unable to call* the onCreateDialog method that I have *defined in the simple java class.
However, If I define the *onCreateDialog method in MainActivity, I am able to display it successfully.
What Should I pass as Parameter to the non Activity class from MainActivity class so that I am able to display the dialog as defined by showdialog method in JAVA class ???*
I can't display the custom camera image in other Activity. I have an Activity called CamTestActivity for custom camera and this activity have onClick button .When click on this button display that image in other Activity called Imageset Activity, set that image in ImageView.
I want to show the user a flattened pick list of all their contacts phone numbers and it must work from versions 1.6 up. I have read the related questions on SO and the Android documentation for Eclair (http://developer.android.com/resources/articles/contacts.html#legacy).
The problem is, even splitting my code into a factory class and specific implementations does not work for me because using Contacts.CONTENT_URI only shows contacts not individual numbers. What I need is this for version 1.6
Intent intent = new Intent(Intent.ACTION_PICK, Phones.CONTENT_URI); startActivityForResult(intent, REQUEST_PICK_CONTACT);
And the equivalent for 2.0 and above.
Even if I get their example to work, by building against the 2.1 API am I not stopping my app being visible on the Market to users with earlier versions of the OS? I can't launch it against a 1.6 emulator, for example.