Android :: Launching Activity From Overlay OnTap

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.

Android :: Launching Activity from Overlay onTap


Android :: Starting Activity In Overlay OnTap?

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

Android :: Overlay OnTap Not Working After Back Button?

Jul 29, 2010

I have several Overlays drawn on a MapView with ItemizedOverlay, and an onTap that works when I first start my app. However, if I press the Back button on the Android then start my app again the onTap does not work at all. Other touch sensative operations work fine, like long press on the map and several face buttons. It is also fine if I press the Home button on the phone then go back into my app, so its only on the Back button. It will also work if I first open another app like the Maps app, then go back into my app, acting like a reset.

Overriding the onBackPressed method to move the task to the background also does not work, does anyone have any ideas what would cause this? It happens in both the emulator and on a real device.

I don't know if it will help but here is the relevent code:

CODE:...........................

View 1 Replies View Related

Android :: How To Return Location Pressed To MapActivity From An Overlay OnTap Method

Aug 30, 2010

I have an activity that has a button which opens a new MapActivity to select a location by tapping on the map.

The map has an overlay that overrides the onTap method to get the location but I want to return that location to the previous activity but, I don't know how to return the geopoint to the mapactivity in order to call the setResult() and finish() methods, because I can't call them from the Overlay.onTap method.

View 2 Replies View Related

Android :: Android Maps Overlay OnTap Click

May 5, 2010

Could anyone help me with my below program. I'm unable to put a transparent label containing the contents from my HelloGoogleMaps.java class (Hola, Mundo!) when i click the markers(the android icon) in the map. I would like to have the ontap event do it for different markers here so that that particular location details is popped up. It needs to be in a canvas display. Upon clicking this new canvas label, it should take me to a seperate activity displaying complete details. I'm using the sample program given in the Google Android Website http://developer.android.com/resources/tutorials/views/hello-mapview and i want to extended it to the next level. Import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import com.google.android.maps.OverlayItem; import android.app.Activity; import android.graphics.drawable.Drawable; import android.os.Bundle;

View 2 Replies View Related

Android :: Android Map Overlay OnTouchEvent / OnTap How To?

Apr 9, 2010

I've implemented a Class that extends Overlay and also override the onTap / onTouchEvent (tried both). Right now it seems like that event is triggered when you tap on the map regardless of position.How can I make sure that the event is triggered only when you tap over the overlay you have added?

View 2 Replies View Related

Android :: Disable Activity Slide-in Animation When Launching New Activity?

Feb 18, 2010

have an activity which launches another activity, via a button click. By default, on newer OS versions of android, the OS will animate the new activity sliding in from right to left.Is there a way to disable this animation? I just want the new activity to appear without any sort of animation.

View 5 Replies View Related

Android :: Launching Activity From Status Bar Creates New Activity / Even When One Already Exists

Nov 9, 2010

I have an activity that starts a long-running service which in turn adds an icon to the status bar. When the activity gets invisible, e.g. by pressing the Home button, and the pressing the icon in the status bar a new activity is created instead of showing the already created activity. If you now press the back button the new activity is destroyed and the activity created in the first place gets visible. How do I make the invisible activity brought to front when pressing the icon in the status bar instead of creating a new activity?

View 1 Replies View Related

Android :: Activity As Overlay Over Other App

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

Android :: Handle Existing Instance Root Activity Launching Root Activity From Intent Filter

Apr 3, 2010

I'm having difficulties handling multiple instances of my root (main) activity for my application. My app in question has an intent filter in place to launch my application when opening an email attatchment from the "Email" app. My problem is if I launch my application first through the the android applications screen and then launch my application via opening the Email attachment it creates two instances of my root activity. steps: Launch root activity A, press home Open email attachment, intent filter triggers launches root activity A Is it possible when opening the Email attachment that when the OS tries to launch my application it detects there is already an instance of it running and use that or remove/clear that instance?

View 1 Replies View Related

Android :: Start Activity From Overlay In Maps

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

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 View Related

Android :: Launching Another Activity From Application

May 22, 2010

I am trying to launch another application from my Activity. Something weird happens when I am running this code :
Intent myIntent = new Intent( Intent.ACTION_MAIN, null );
myIntent.addCategory( Intent.CATEGORY_LAUNCHER );
myIntent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED );
ComponentName compName=new ComponentName(myArray[i][0], myArray[i] [1] );
// String[][] myArray myIntent.setComponent( compName ); startActivity( myIntent );

I have this error :
android.content.ActivityNotFoundException: Unable to find explicit activity class { com.android.settings/com.android.settings.Settings};
Have you declared this activity in your AndroidManifest.xml?
But when I replace this line
// myArray[i][0] = "com.android.settings" // myArray[i][1] = "com.android.settings.Settings" ComponentName compName=new ComponentName(myArray[i][0], myArray[i] [1] );
with ComponentName compName=new ComponentName("com.android.settings","com.android.settings.Settings");
And without any modification in my manifest, it works!

View 2 Replies View Related

Android :: Launching Activity Through Intents

Aug 9, 2010

I am implementing a simple app. I need to start an activity based on the state of the Activity. Lets take i am using a button to start the activity.
1. If the activity is not started, I need to start XYZ activity.
2. If the XYZ activity is on focus, then i need to close the activity on the button press.
3. If the XYZ activity is not in focus (like onPause) state then, I need to change the button state.Can you please help me in the flags that i need to use for starting the intent. Is it possible to get the state of activity before I start that activity?

View 2 Replies View Related

Android :: Launching An Activity Using Linkify

Jul 22, 2010

I'm not sure if this can be done, but is it possible to launch an activity from text that has been Linkified? I'm basically providing an illustrated glossary, and when the user clicks on a highlighted term, I want the activity that handles display of the image and associated text to fire up. I also need to pass in some parameters to the activity being launched.

View 3 Replies View Related

Android :: Activity Not Launching MapActivity

May 6, 2010

I have a TabActivity that loads in 3 activity classes.In those Activity classes I have a button and an OnClickListener that tries to open a MapActivity class.I have searched to find an example of an Activity class launching a MapActivity class but cannot find one. If I swap out my MapActivity class with a Activity class it works.

View 2 Replies View Related

Android :: Dialog Theme When Launching From Another Activity

Aug 24, 2009

I am facing a strange problem. I have 2 activities.The Second activity having the theme.Dialog (set in manifest). when I launched the second activity from first activity via startActivityforResult(). The Second activity is not Visible.

View 8 Replies View Related

Android :: Launching Browser In Preference Activity

Jan 11, 2010

I want to List Item in Preference activity. and I want to launch a Browser with a URL which can change dynamically, When I click on that Item. Can anyone let me know how can i Achieve?

View 4 Replies View Related

Android :: Launching An Activity From Widget Click

May 19, 2009

I am working my way through oh my first widget (so this is 1.5, obviously) and I'm stuck. I've poked around a problem involving the launch of an Activity when clicking on a widget. Scenario: User drags widget on home screen without prior launch of the Activity in question. I am following this post: http://android-developers.blogspot.com/2009/04/introducing-home-scree... Instead of launching the browser through ACTION_VIEW, I am trying to launch an Activity by class. I've toyed around with different Intent settings, but no luck.

View 7 Replies View Related

Android :: Launching An External Activity From Widget

Dec 22, 2009

I have written a widget that cycles through a series of movie poster images with next/prev buttons.This works.There is another button on the widget that needs to launch an external activity, sending it the name of the shown movie.The other activity is not in the same namespace, package or eclipse project as the widget.It is written by another developer and its apk is installed on my emulator.

View 7 Replies View Related

Android :: Launching Correct Activity On Resume

Jan 22, 2010

I'm currently working with a two-activity application. The first activity allows the user to choose options for their upload, and the second activity displays a ListView of their results once processed.I have code in place that performs the uploads/downloads in the background, regardless of whether the application is currently in focus or not (thanks to Matthias Kaeppler's Droid-Fu).I would like to have my application Resume into my second (results) activity when a user clicks on the icon from the top-level launcher, regardless of how long they have been away from the app. I thought that the 'alwaysRetainTaskState' flag in the Manifest would do it, but I've not had success with that. Can anyone tell me how I need to set up my Manifest to get this functionality?

View 19 Replies View Related

Android :: Launching Activity At Its Current State

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

Android :: Launching Intent Can't Find Activity

Jul 2, 2010

My program has a list of tabs that each contain a list of people.Clicking a person should edit their details, but instead, clicking a person throws an ActivityNotFoundException.

View 2 Replies View Related

Android :: Launching Intent From Class Outside An Activity

Jul 28, 2010

I've got two activities, one of them is called MyActivity. I want both of them to be able to use a function located in a class othat we may call MyClass. In MyClass, I try to use an intent to launch the activity AnotherActivity. Since the constructor takes a context as parameter, I simply tried to store a context from the activity in the constructor, and then use it when I try to create my intent.However, even thought none of the arguments are null (checked that with a simple if-statement), intent seems to be null and a NullPointerException is thrown. Why does it not work, and what can I do to solve the problem?
I'm quite new to Android and Java development, so please explain it as basic as you can.

View 2 Replies View Related

Android :: Application Component Not Instantiated Before Launching Activity

Dec 17, 2009

I got a null pointer exception in an Activity onCreate() while trying to access my Application object (extended from android.app.Application).This exception occurred very rarely and i have no way to reproduce this again.My App starts a service on BOOT_COMPLETED intent and the null pointer exception seems to have occurred during boot up. Can somebody please throw some light on this issue? Application should have been created before creating any activities.

View 2 Replies View Related

Android :: Prevent Duplicate Browser / Activity Launching

Jun 29, 2010

I would like to know if there is a way of preventing a duplicate launch of browser/activity, while the user is already focused on it.mybe there is a way to detect before if the user's current screen is already focused on the same activity/browser i intent to launch?

View 2 Replies View Related

Android :: Identifying Which Widget Click Is Launching Activity?

Jun 8, 2009

I m creating my own widget widget initial layout contains one button.when i click on that widget button it shud launch the specified activity using service everything is working fine..but the problem comes when there are 2 or more widget on home screen when i clicking on any one of them i m not able to specify with widget is launching the activity.

View 6 Replies View Related

Android :: Bug In Activity Stack If Launching From Home Icon?

Jul 24, 2009

I've noticed some strange behaviour with resuming a task from a Home icon.Very easy to replicate, just create a new bare bones android project using eclipse, don't need to add anything. Then follow these steps:

1. In eclipse, Run the project on a emulator or device.

2. Once the app installs and launches the first activity, press Home key.

3. Launch the app again by pressing its icon.

4. Press Back key. Now this part seems wrong, you'll go back to the original activity in the stack, instead of the Home screen, even though its been previously launched and what you expect is it to bring back the stack as it was left, with one activity. If you repeat steps 2-3, it will just keep adding the same activity to the stack.

That is until you press Back all the way through the stack to the Home screen.Now this behaviour will never again replicate. It will be the correct (?) behaviour of bringing back the stack history at the state it was when Home was pressed. Note there are no behavioural modifications, this is just a default application. However, I tried many combinations of launchModes and stack clearing, they had no effect on the first run. Unless I'm interpreting the documentation wrong, when the user presses the Home key, the task is moved in to the background and simply brought back the next time they press the app icon? Why is the app icon altering the task it creates, if it already exists (with no flag modifications)?

View 3 Replies View Related

Android :: Map Open Overlay When Pin Is Clicked - Overlay Contains Description / Button

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

Android :: After Killing Task Droid Not Launching Correct Activity / What Is Happening?

Aug 19, 2009

Our application is defined to launch a SplashScreenActivity from Intent { action=android.intent.action.MAIN categories= {android.intent.category.LAUNCHER} . After the SplashScreenActivity does its work, it launches another intent to launch MainMenuActivity and finish() is called on SplashScreenActivity.

When we run our app for the first time on our phone, the SplashScreenActivity launches OK, and correctly launches the MainMenuActivity.

However, if we kill the app using TaskKiller, LOGCAT indicates that the application has been killed. I can't debug the app, because launching it from eclipse with the debugger makes it work OK, because it reinstalls the app. Perhaps there is a way to launch the app without reinstalling it?

Here is the Log of us killing our app...

When we launch the application again, the LOG messages for SplashScreenActivity are not logged and it looks from LOGCAT that Android is launching the MainMenuActivity instead. Here is the log...

Can someone Romaine, Diane help us understand what is happening? We saw this happening because some variables are initialized in SplashScreenActivity that aren't available with MainMenuActivity and we were getting NPEs.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved