intent

Passing A Bundle From A Running Thread To An Activity Launched By An Intent From Within It- Android

I have a running game thread (lets call it 'A') that will call a new activity to start from within it ('B'). The game thread object itself is declared and run from another activity 'C' though so how can I pass a Bundle from 'A' to 'B'? An intent is used in 'A' to launch 'B' but would a different method be applicable? I cannot just creat...

Animation transition between activities using FLAG_ACTIVITY_CLEAR_TOP

Hey hey! In my android app, I'm making a method that pop all activities and bring up the first activity. I use this code: Intent intent = new Intent(this, MMConnection.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); this.startActivity(intent); As I noticed that the transition was still a left to right animation, does someon...

Android - How to intercept the 'Install application' intent

OK, so not entirely sure this is possible... But trying to write an application so that I can run some code before any of the following activities are performed. 1) APK is downloaded from web and market launches installer 2) Install button is pressed on android market Is it possible to intercept and prompt on these events, or has Goo...

Launching Google Maps and Navigator from Android App

I have an android application which allows the user to open up google maps or navigator to show a certain address. This functionality was working in the past, but now I get the following error and the app crashes: ERROR/AndroidRuntime(2165): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.int...

Android: Starting An Activity For A Different Third Party App

Hi, I'm working on an app and I want to integrate the Last.fm app into it. Basically, when someone is looking at an artist in my app, I would like to have a button that they can tap to open up Last.fm application with the artist's information. This intent works, but it loads a menu asking which app I would like to use (Browser or Last....

Android - Is there a system broadcast intent when an app is killed to reclaim resources?

I'm attempting to write a BroadcastReceiver to be notified when the Android OS kills an app in order to reclaim resources. I've tried filtering on "android.intent.action.PACKAGE_RESTARTED" but I never seem to receive that broadcast, even when I force close an application. So, am I using the correct intent action filter? If not, what i...

How to put a Vector into an intent.extra?

Hi :-), I've started to write a small app for android. It looks very nice, but there is one thing I don't understand. I've created a new intent in the activity A and I've added a serialized vector intent.putExtra("key", vector). On the called activity B I'm doing this: Vector<ItemModel> items = (Vector<ItemModel>) getIntent().getExtras...

Passing image to another activity

I figured out how to pass a String value between activites thanks to this site, however I'm having trouble passing an image. What I'm trying to to is have a user click a button that opens the gallery and allows selecting of a picture. Then I have another button that opens another activity that displays an ImageView. I want to be able to ...

Accessing the phonebook on Galaxy S crashes the app

Does anyone know how to access the contacts from the Galaxy S? I have this line of code: Intent intent = new Intent(Intent.ACTION_VIEW, Contacts.CONTENT_URI); startActivity(intent); and it works on the emulator as well as on the Samsung i5700. I tried running my app on Samsung i9000 (Galaxy S) but it crashes. I am getting the follo...

Launching default apps with intents

How, in android, do I start an app set as the default (i.e. Handcent for Messaging, Dolphin for browsing)? I can only find how to use definite package names for intents: Intent i = new Intent(Intent.ACTION_MAIN); i.addCategory(Intent.CATEGORY_LAUNCHER); switch (position) { case 0: //messages i.setPa...

Using an IntentService to do Prioritized Networking

I've been wondering if it is possible to use an IntentService to do some networking while keeping the queue of pending intents prioritized. My goal to be able to download some images in the background, add more if needed (send another Intent) and be able to reset the queue if necessary (preferably using a specific Intent). That is all po...

Android intent filter data path example

I tried using the following data in my intent filter: <data android:scheme="http" android:host="an.example.i.p" android:pathPrefix="t" /> Why doesn't the following url trigger it? http://an.example.i.p/t/v2.aspx/chase/a.test.auto ...

Using the IF statement to see what intent started the activity - ANDROID

Hi there Hopefully this is very simple. I have a central activity that can be launched from two separate classes. I was hoping that in this central activity I could have an IF statement like if(this.getIntent() == MainMenu.class) { // Do something here } But obviously that isn't legal so how could I structure an expression to chec...

What Action to invoke the Video Camera in Android?

Is it possible to call the built-in Video Recorder in Android through an implicit Intent? I did some search but haven't figured out yet. Many thanks. ...

Android: Open Browser with Supplying Session Cookie

Hi, I'm currently looking for a way to launch the default browser application on Android and pass a session cookie to it. My application communicates with an external API over which I have no control using HttpClient, then passes the user to the site for the final stages. I am aware that this is probably possible using a WebView, Howe...

Programatically starting the 'Add Account' activity in Android 2.2

I've been experimenting with the Android SDK over the past few days, in readiness to write an App for the store, however I've run across a bit of a problem. The App I'll be writing requires that the user has a Google account associated with the phone. Retreiving and making use of the Auth token etc was not a problem, however I would lik...

Android: Detect another application has started playing audio

My music application constantly plays music in the background, however I'd like to be able to detect when another application starts playing audio (such as the YouTube app) so I can pause/mute/stop the audio in my application. This will allow a user to continue browsing the web whilst listening to music, but then if they wish to watch a...

How to switch to new Activity from menu?

I have a menu and would like to open a new Activity when the user clicks on the menu item: @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection switch (item.getItemId()) { case R.id.add_symbol: System.out.println("ADD SYMBOL CLICKED!"); Intent myIntent...

Android: Different start activity depending on user preference

My application starts with a welcome screen Activity, but that screen has an option to skip that screen altogether in future launches. What's the proper Android way to do this? Initially, I just automatically detected the skipWelcome preference and switched to the 2nd activity from Welcome. But this had the effect of allowing the use...

Intent to launch the clock application on android

Hello, I am facing a problem with a clock widget i made. I want the user to touch the clock and launch the clock app on the phone. this is the code: //this worked on my nexus 2.1 if(VERSION.SDK.equals("7")){ RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget); Intent AlarmClockIntent ...