Android :: Opening Another Activity From The Map Overlay Dialogs
Jul 22, 2010
I am trying to create a map application and I need to do something similar to what Google Maps does. I want to open show a list of locations and when user taps on them I want to show a dialog.
I was able to do it till here. But now when the user clicks on the dialog that opened I want to show another acttivity with the details of that item that they clicked on.
I tried to start a new intent but it gives me an error.
Here is what I am doing
CODE:..................
Here is the stack trace
CODE:........
Why am I getting this error and how can I resolve this and open a new activity? Also where can I find the source code for the google maps on android?
View 1 Replies
Sep 30, 2010
In my activity, I show a dialog under some condition like this:
CODE:.......................
My question is what do I need to do to ensure there is no resource leak? From the logcat, i see there is a case where it said a window is leaking or something like that.
View 1 Replies
View Related
Jul 19, 2010
Im writing a program that offers a quick reply dialog upon receipt of an SMS.
However, I am getting an unexpected result. When I receieve an SMS, the appropriate dialog activity comes up displaying the correct phone number and message, however there is a second activity behind it that is the 'default' activity in my program (it is what opens when i launch my application)
I do not want this second activity to come up. The quick reply activity should come up by itself over top of whatever the user was doing before.
The 'floating' activity:
CODE:.........
The call to the activity inside an onReceive()
CODE:..............
The Manifest:
CODE:.................
View 1 Replies
View Related
Aug 12, 2010
I'm working on an app that launches the browser activity to perform a Twitter OAuth authorization. This process uses a callback url which will re-launch the activity that started the browser activity in the first place.My problem is that the browser pages remain in the history stack and when the user then clicks back from the preferences activity that launched the browser in the first place, they don't go back to the app's main activity, but instead are brought back to the browser. I've tried adding flags to the launching intent to prevent history and reset on clear, but it doesn't seem to work when running on my phone, only on the emulators.
View 1 Replies
View Related
Sep 23, 2009
Is it possible to create an Android activity as an overlay above other application? If yes, please provide me a pointer.
View 7 Replies
View Related
Feb 10, 2009
I am wondering if I am going about this problem the correct way.I am making an app that places overlays on top of google maps.When you click on the overlay it should launch a dialog type window that will give you options on what to do with that overlay.It is the line startActivity where the app throws an exception.I did the setFlags because an error message said it was needed because I was trying to start the Activity while outside an Activity.That makes me think I am going about this wrong.I have 'MyActivity' listed in my manifest so I don't think that is the issue.I have searched for this problem on the internet and I can't seem to find anyone else running into this so that is another reason I think I may be trying to do this the wrong way.
View 3 Replies
View Related
Jul 22, 2010
I am trying to create a map application and I need to do something similar to what Google Maps does. I want to open show a list of locations and when user taps on them I want to show a dialog.
I was able to do it till here. But now when the user clicks on the dialog that opened I want to show another acttivity with the details of that item that they clicked on.
I tried to start a new intent but it gives me an error.
Here is what I am doing
CODE:...................
Here is the stack trace E/AndroidRuntime( 4985): java.lang.RuntimeException:
Unable to start activity ComponentInfo{com.achie.test.mapssample/ com.achie.test.mapssample.ItemDetailView}:
CODE:........
Why am I getting this error and how can I resolve this and open a new activity?
Also where can I find the source code for the google maps on android?
View 4 Replies
View Related
Feb 10, 2009
I am attempting to launch a dialog type window when I click an Overlay that has been placed on google maps. I thought the way I would do this was Override the onTap() method, create an intent, and call startActivity on that intent as follows:
CODE:..........
It looks like the program throws an ActivityNotFoundException when executing that last line. The exception reads that if you try to start an Activity while you are not in an Activity you need to set the FLAG_ACTIVITY_NEW_TASK flag which is why that line is there. I have included MyActivity in my manifest.
'context' is passed to my class constructor that extends Overlay and is the MapActivity that I am using to display the map.
View 2 Replies
View Related
Aug 4, 2010
I am trying to open a Resource by passing the result of context.getResources().getString(R.drawable.myimage) to another class that is not an activity. context.getResources().getString(R.drawable.myimage) returns res/drawable-mdpi/myimage.png However, when I try and open this file, it throws a FileNotFoundException. What is the proper way to open a resource outside an activity?
View 1 Replies
View Related
Aug 22, 2010
I'm having a struggle understanding why my intent is not working. I basically just copied paste from other examples in my code that work perfectly like this. Here it is:
Intent addIntent = new Intent(v.getContext(), thenNnowMode.class);
Bundle w = new Bundle(); String activityName = "addPic";
w.putString("activity", activityName);
w.putParcelable("bitmap", selectedDeviceImage);
//a.putString("id", picId); addIntent.putExtras(w);
startActivity(addIntent); finish();
The intent is opening a different class called thenNnow.class instead of thenNnowMode.class and I have no idea why this is happening. I've tried sending the intent to open other activities other than thenNnowMode but it always opens thenNnow. Am I missing some silly syntax mistake? It's so strange, its the same code. I am not sure if it's relevant but the thenNnowMode class uses the device camera
View 23 Replies
View Related
Apr 12, 2010
What i'm trying to do is to open an Activity when i click on a button.
This is my code in my main activity.
CODE:...........
The program launches no problem when i just implement the first button (restuarant).
But when i try to implement the button that i have commented out it fails to launch. and yes i have added the activity to the manifest file.
View 1 Replies
View Related
Aug 18, 2010
I like tu use the MapActivity to display some pins. When a pin is pressed i like to open a description. This can I obtain following the tutorial: http://developer.android.com /resources /tutorials/views/hello-mapview. But now I like to put a button on the overlay window. That button should open a detail activity. How can I make this? How is possible to personalize the overlay "info window"?
View 2 Replies
View Related
Jun 14, 2010
In an Android app, whenever the activity launches, the textbox gets the focus and the soft keyboard pops up automatically. I have tried to stop this by using following line in onCreate method, but it does not work.
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(EditText.getWindowToken(), 0);
View 4 Replies
View Related
Aug 9, 2010
I have a need to capture some user input when an activity opens for the first time. I'm hoping to give the user a list of options to select from, which will be pulled in dynamically. I'll then store the selected value locally for future use. I'm not finding a way to do what I'm after and was wondering if anyone has run into this before and how they solved it.
Fantasy Football<http://chriswstewart.com/android-applications/fantasy-football/>- Android app for fantasy football fanatics and MFL owners Social Updater<http://chriswstewart.com/android-applications/social-updater/>- An easy way to send your status blast to multiple social networks
View 9 Replies
View Related
May 5, 2010
I am writing an app that requires you to be logged in to a service before using it. From my understanding of android so far, you have to choose which activity to launch when you open from the launcher in the manifest. I don't know which activity i want to launch at compile time. I want the user to click the icon, then I check and see if they're logged in, then decide based on that whether to launch the login activity, or the main app activity. Is there a way to do this?
View 1 Replies
View Related
May 26, 2010
I have been having a problem with a notification not opening/going to the correct activity when it has been clicked. My notification code (located in a class which extends Service):
Context context = getApplicationContext();
CharSequence contentTitle = "Notification";
CharSequence contentText = "New Notification";
final Notification notifyDetails = new Notification(R.drawable.icon, "Consider yourself notified", System.currentTimeMillis());
Intent notifyIntent = new Intent(context, MainActivity.class);
PendingIntent intent = PendingIntent.getActivity(context, 0,notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT | Notification.FLAG_AUTO_CANCEL);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
((NotificationManager)getSystemService(NOTIFICATION_SERVICE)).notify(NOTIFICATION_ID, notifyDetails);
If I click the notification while the application which created the service is open, the notification disappears (due to the FLAG_AUTO_CANCEL) but the activity does not switch. If I click the notification from the home screen, the notification disappears and my app is brought to the front, however it remains on the activity which was open before going to the home screen, instead of going to the main screen. How do I specify the activity that will be pulled up?
View 1 Replies
View Related
Mar 5, 2010
I'm doing an APP that shows some dialogs. Those dialogs are Alert dialogs, and when they are being showed if I change the orientation of the mobile I lost them...they are not being kept on the screen.
View 13 Replies
View Related
May 31, 2009
I have 6 options to put in options Menu, but 3 of them are not so important and i want to hide them in submenu. All of my Activities are started from one ActivityGroup which creates Menu on MENU button press. Problem is that when I open SubMenu or Dialog (which is created and displayed by ActivityGroup) my current foreground activity makes onPause, onStop and onDestroy, and when I close this submenu (using "back" key) or dialog (by "ok" button for ex.) I don't have any response (onCreate, onResume) from any of my activities registered in LocalActivityManager.
View 3 Replies
View Related
Feb 8, 2010
I decided to share the solution i found to the problem of Android not supporting real modal dialogs.The solution was to draw the dialog by myself. :-( Well, at least worked fine, besides the problem that its a bit ugly.
View 17 Replies
View Related
Apr 26, 2010
I have tried to make a series of dialogs, like a questionnaire, that the user needs to answers a series of questions selecting one or more checkboxes. I can do one, just fine, but when I try to make more than one question (lets say 10), it does not show, or show all the dialogs. I tried using dialogs or new acitivities.
So, my problem is I have multiple questions, one to be presented each time, and I need to wait for one to be responded so I can ask the next one. How do I accomplish this?
My first attempt was with a dialog box... but obviously it got all the boxes stacked in each other:
CODE:.................
View 4 Replies
View Related
Feb 5, 2009
I intended to show a dialog in a service process, then I tried to use the AlertDialog but got the below error message: WindowManager$BadTokenException: Unable to add window -- token null is not for an application The reason seems to be that the dialog is not used in a application context (activity should be fine?) Was there any way that can solve this problem?
View 2 Replies
View Related
Jul 14, 2009
I'm facing the same head-scratching moment similar to what this person (from Jan 2008) experienced when I realize that there is no cancel button in Android's progress dialog or spinners. It is now July 2009 and I've just installed the cupcake version of Android. Has this thing changed ? If not, are you adding a cancel button into the dialogs and how do you do it ?
View 4 Replies
View Related
Sep 24, 2009
I wonder what is the right way to implement this? Could anybody advice whether my solution is correct?
So:
Activity is created
User clicks on button and dialog is launched (Dialog, not dialog styled activity)
User opens keyboard
we have onSaveInstanceState called where we save that our dialog was opened and all respective dialog input
we have onRestoreInstanceState and here we check whether dialog was shown, recreate the dialog with respective input.
Is it the right approach? or there is smth. that is done by Android and I am doing some redundant actions.
View 2 Replies
View Related
Jun 25, 2010
I use the AlertDialog class in my application. By default, these alert dialogs have a transparent background. I'm trying to use an opaque background instead, very unsuccessfully.
These are my styles:
CODE:....................
I applied the "MyOpaqueActivity" style successfully for whole activities (the window background is changed to "my_background"), but it doesn't work for alert dialogs within those activities. The "alertDialogStyle" attribute and my "MyOpaqueAlertDialog" style don't seem to have any effect.
So how can I change the background of these alert dialogs?
View 2 Replies
View Related
Jul 29, 2010
I've read on Reto Meier's blog that he doesn't recommend the use of modal "Loading" dialogs in Android applications. Is this a general consensus among developers? If I have a login screen what should I display when the user tries to sign in? Until now, I have used a "Signing in" indeterminate progress dialog. Should I use the application's progress bar? Should I use a Toast? And, in the general case, when should I use dialogs and when not to?
View 1 Replies
View Related
Nov 18, 2009
I am rendering an EditText as one element of a list-style AlertDialog (which is backed by the default ListView implementation). I sort of expected that this circumstance would not change the behavior of EditText, but it does: a click on the EditText does not spawn the soft keyboard anymore.
After an hour of messing around with focus settings and click handlers I got fed up and debugged into InputMethodManager.showSoftInput(), and found this:
CODE:....................
The problem here is that mServedView is the ListView that's backing the dialog, while view is the EditText, and ListView.checkInputConnectionProxy() does simply return false in the default implementation of ListView (to be overridden by subclasses).
Worse, I couldn't find a way to set a custom ListView which allows proxying IME reuqests; AlertDialog.Builder.setView() accepts a custom ListView, but this is not the ListView that InputMethodManager sees.
View 2 Replies
View Related
Jun 22, 2010
i want to display a dialog in my android application where certain TextViews in the layout need to have content set during runtime. while showing the dialog itself is no problem at all, accessing the TextViews via TextView.setText(String) crashes the application.
View 2 Replies
View Related
Sep 17, 2009
I've had this problem in a few different apps now and I can't seem to find a solution.
If, in the onCreate() of an Activity, I start an activity that uses the dialog theme it doesn't draw anything to screen... the whole screen stays black. All the views are there (e.g., I can tap where an EditText should be and it'll give me the keyboard), they're just not visible. code...
View 2 Replies
View Related
Jun 13, 2009
Does anyone know how to make a dialog fill the screen width in landscape mode? Setting the layout's width to fill_parent doesn't do it. It always comes up portrait width, or something suspiciously similar.
View 3 Replies
View Related
Feb 14, 2010
I have HTC Hero, and i see that TimePickerDialog and DatePickerDialog were changed by HTC (they look different than those in the emulator). My question is how can i change such system level dialogs?
View 1 Replies
View Related