Android :: What Is Point Of Defining Actions Within Intent Filters On A Receiver Tag

Apr 15, 2010

I'm currently exploring Broadcast Receivers and Broadcast Intent. There are some aspects of the tutorials which are ambiguous to me. To my knowledge this is how the process works. I can broadcast an intent from my application and any receiver on the phone can act on that intent as long as the actions match. I can register a broadcaster receiver on anything that extends Context and when I do so I must provide a filter which will allow the receiver to act on one or more intent actions.The part which confuses me is defining a receiver via the manifest. Must the name of said receiver match a class name? Why should I ever define an intent filter with an action in the project manifest if I always have to provide another intent filter when I register my receiver in code?

Android :: What is point of defining actions within intent filters on a receiver tag


Android :: What Are Intent Filters Exactly

Jul 3, 2010

I've read lots of articles about intent filters and I really can't understand exactly what they do? so please if anybody can explain to me with a clear example what is the role of intent filters exactly ?

View 4 Replies View Related

Android :: What Are Intent-filters

Jul 23, 2010

In my android app, I wanted to start an activity 'B' from initial activity 'A'. I have created classes for both of these. However when using following code to start B, I get runtime error as application has stopped unexpectedly, try again.

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

When I added a new entry in AndroidManifest.xml/manifest/application/activity/intent-filers for activity B then the application worked.

I have two questions:

When there are multiple activities entries in AndroidManifest.xml, how does android know which activity to start first?
I could not understand intent-filters.

Here is my partial AndroidManifest.xml

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

View 1 Replies View Related

Android :: Not Able To Found Intent Filters

Oct 31, 2010

I'm writing a client application for an Italian social network (Meemi) and I'd like to give the possibility to users to share their calendar events via my client. I noticed on my device (HTC Desire) that is possible to access to a "share chooser" from the Calendar event list: in fact I can share via email, sms, and bluetooth. I'd like to add my client to the this sharing list: but I'm not able to found the right intent filter to use.

View 2 Replies View Related

Android :: List Of All Available Intent Filters ?

Nov 4, 2010

I have search Android docs and for some insane reason I am not able to find the list of all available intent filters.

I am finding an intent filter, which would do something like , notifying me through Broadcast Receiver that a particular Activity (example browser, or email ) has been started or in foreground. Can anyone help me with that .

View 1 Replies View Related

Android :: 2 Intent Filters - 1 Activity - Which Opened It?

Aug 1, 2010

Is there a way to know which Intent Filter is responsible for launching an Activity which has two Intent Filters defined in AndroidManifest.xml? I want a slightly different set of logic, but not enough that should require a whole new Activity.

View 1 Replies View Related

Android :: Listing An Application's Activity And Intent-filters

Jun 10, 2010

I am interested in activating another application's activity. I know from reading the Android SDK that it's probably better to do this with an implicit intent. However, this activity doesn't reside in an application I own, so I don't know the action and category and data flags on the intent-filter.

How can I examine an Android applications metadata like the activity classes and the intent-filters for those activities (if declared in the manifest)?

View 2 Replies View Related

Android : Using Intents / Intent Filters And Mime Types?

Feb 22, 2009

I've been grappling with an issue all day.

I am trying to create a program to deal with .torrent files that are clicked on and/or downloaded by the browser. Currently the downloader reports "Cannot download. the content being downloaded is not supported on the phone"

Im fairly sure this is doable as i recently encountered the same issue with pdf files untill i installed a pdf reader.

View 4 Replies View Related

Android :: Intent Filters - Prevent Creation Of Multiple Activity Instances?

Feb 16, 2010

I added an intent filter to one of my activities, so that when a user clicks a URL like "www.mysite.com", and if my app is installed, my registered activity can be launched. It works well.

I see that this creates a new instance of my registered activity though, every time a link is clicked. Is there any way to prevent multiple instances from being created - just recycle an existing instance if one already exists?

View 6 Replies View Related

Android :: Default When Using Multiple Actions In Intent-Filter

Jul 6, 2010

Trying to grok intents and actions in android and looking through the documentation. But one thing I keep seeing is an intent filter with multiple actions defined.

Like this, from the above link:

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

But, if you call that activity, how does it choose which action is chosen?

For that matter, that linked to example has multiple activities that all contain the same actions, "android.intent.action.VIEW" for example. When calling this with something like content://com.google.provider.NotePad/notes how does it even know which activity to use?

View 1 Replies View Related

Android :: Android Intent Filters To Intercept URL / How To Use Correctly?

Aug 27, 2010

I have an intent filter to intercept urls from the browser on my domain. This will give the user the the choice of using the native application or the browser. I have setup the following intent filter as so.

<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="myDomain" android:pathPrefix="/custom/" android:scheme="http" />
</intent-filter>

Now, it's not my intention to trap the user in the native application as there is much benefit from using the browser. So I would like to give the user some ability to go back to the browser within the application. I have created a button with an onClick that simply creates an intent for View and the url that would represent it. This will present the user with the choice dialog again. The catch to this is that a user is also allowed to select a checkbox to always use the native application. While that is well and good, sometimes absolutes are wrong.

So if I am reading a blog post that mentions a specific url and a specific part of that document, intercepting the url is not what the user intended but will send them to the native application. Also then upon selecting the button with the intent, they will immediately be sucked back into the application. How can you structure a ACTION_VIEW intent for the system browser or at least detect that the user has selected always use the native app so that you can use the ACTION_WEB_SEARCH (it has a different UI behavior with the history stack, which is why I wouldn't opt to use this action all the time).

View 1 Replies View Related

Android :: Intent Receiver According To Preference

Apr 9, 2010

I have a intent receiver in my android manifest, but would like to give the user the opportunity to choose whether he/her wants the app to automatically start at the specific state. Until now, I've used a service with a broadcast receiver, but I really want to delete this service as it seems a bit unnecessary.

Can register the intent action only if the user wants it (I guess not)? If not, should I make a class that will be called every time the intent is received and checks the user's preference or should I keep the service?

View 1 Replies View Related

Android :: Cannot SendBroadcast Intent To Receiver Which Has Permission

Mar 12, 2010

I created a broadcast receiver with permission as below,

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

Also, In my Manifest file, I added uses permission ( <uses-permission android:name="com.suku.test"/>).

When I try to broadcast Intent, I'm getting the following error,

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

Any Idea why I'm getting this error?.

View 5 Replies View Related

Android :: Create A New Intent For Another App's Broadcast Receiver?

Jul 23, 2010

In the examples, they create Intent as:

Intent intent = new Intent(this, AlarmReceiver.class);

But suppose my AlarmReceiver class is in another app, how do I create this intent?

I've tried with

new Intent("com.app.AlarmReceiver")

but nothing happens.. It was not called..

--Broadcast definition added using the manifest editor on Eclipse:

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

View 1 Replies View Related

Android :: How Broadcast Receiver And Intent Filter Behaves?

Jul 6, 2010

I am new to android platform.please help me out how the Broadcast Receiver and Intent Filter behaves in android.please explain in simple line or with example.

View 1 Replies View Related

Android :: Capturing HOME Intent With Receiver Programmatically

Feb 9, 2010

I am trying to capture my activity to handle HOME button press with a receiver programmatically, but the event is not firing. I can, however, successfully register and capture this intent filter if I declare it in a manifest.xml activity section.

Here's the code for the receiver:

CDE:...............

I put a breakpoint here to see if this gets called } };

View 2 Replies View Related

Android :: 1.6 SDK Level 4 Project / Receiver Intent Filter Never Invoked

Apr 4, 2010

I'm trying to get a BroadcastReceiver invoked when the screen is turned on. In my AndroidManifest.xml I have specified:

<receiver android:name="IntentReceiver">
<intent-filter>
<action android:name="android.intent.action.SCREEN_ON">
</action>
</intent-filter>
</receiver>

However it seems the receiver is never invoked (breakpoints don't fire, log statements ignored). I've swapped out SCREEN_ON for BOOT_COMPLETED for a test, and this does get invoked. This is in a 1.6 (SDK level 4) project. A Google Code Search revealed this, I downloaded the project and synced it, converted it to work with latest tools, but it too is not able to intercept that event.

http://www.google.com/codesearch/p?hl=en#_8L9bayv7qE/trunk/phxandroid-intent-query/AndroidManifest.xml&q=android.intent.action.SCREEN_ON

Is this perhaps no longer supported? Previously I have been able to intercept this event successfully with a call to Context.registerReceiver() like so:

registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// ... }
}, new IntentFilter(Intent.ACTION_SCREEN_ON));

However this was performed by a long-living Service. Following sage advice from CommonsWare I have elected to try to remove the long-living Service and use different techniques. But I still need to detect the screen off and on events.

View 1 Replies View Related

Android :: Wrong Intent Supplied To On Time Alarm Receiver

Dec 17, 2009

I am using marks' method of alarmreceiver and appservice. I am trying to pass a record id to the alarmintent through putextra and receive it in ontimealarmreceiver in getExtra. What I observe is, first time record id goes correct (say 11) second time record id is sent 12, but in receiver I receive record id = 11. Third time too record id -11

View 2 Replies View Related

Android :: Apply Alphabetical Filters On ListViewApply Alphabetical Filters On ListView

May 11, 2010

I need to create a list view that display same functionality as Contact App. I need to have a scroller through which i can traverse the list alphabetically. To achieve this i am following an example from API demos "com.example.android.apis.view.List1.java". It is using a textfilter. When i implement this functionality on a static list view => it is working fine. But when i try this on a dynamic listview=> it is not working.

View 2 Replies View Related

Android :: Spinner - How To Do Distinguish User's Actions From Computer's Actions In OnItemSelectedListener

Nov 17, 2010

I'm in a trouble managing a spinner. I have a spinner with its adapter. I initialize the spinner with a list of values when starting my activity. Then I force the selected value to be the one used in the object that I manage.

Once the screen is initialized :
When the user selects a value in the spinner, according to the selected value, I may continue (or not) to another activity for let the user choose a complementary and necessary value.

If the user "cancels" this second activity, I want to rollback the spinner to its previous selected value, and cancel some actions made in the meantime.

If the user goes to the end of the second activity, everything is fine and I want juste to refresh the spinner display with the datas selected in the second activity (I overload the getView method in the adapter to do this).

Overall, I can easily do all of this, however, when I force the selected value in the spinner at the begining of my activity, or whene returning back from the second activity by "Cancel", the change value event is catched and the second activity is triggered (the user did not click anything at all).

How would you allow the second activity to be lauched only if the change of the selected value in the spinner is due to a manual action from the user, and prevent that same second activity to be launched when the value of spinner is changed "in the code "?

I tried many solutions, as setting a boolean into the adapter that tells if the next event will be raised because of an "in the code" action.

Or also putting a boolean in the adapter that tells if the adapter has initialised itself, and I force that boolean to true on the forst change catched event.

View 1 Replies View Related

Android :: Android - Difference Between Intent And Broadcast Receiver

Aug 30, 2010

I am new to android. I what to know the difference between Intent and Broadcast Receiver. I am more confused with Broadcast receiver then Intent. Simple codes will be helpful.

View 1 Replies View Related

Android :: Broadcast Receiver - Create A Broadcast Receiver Which Responds To System Events

Sep 28, 2009

trying to create a broadcast receiver which responds to system events and change system settings. I don't need any interaction from the user so I don't need an activity and have been trying to do everything through the manifest file. I've put a log event into my onReceive method but it never logs anything so I'm presuming my method is never called. I've tried this with both the 1.5 and 1.6 SDKs. I was hoping somebody could have a look at my code please and let me know if there are any problems.

View 2 Replies View Related

Android :: Defining A Callback Function For A Given Value

Sep 13, 2010

In Java, is it possible to associate some object (i.e. a String) with a function to be called ? I have two similar menus and both have a onClickListener with some code like this: Code...

View 4 Replies View Related

Android :: Defining Selector Drawable

Feb 14, 2009

I am trying to setup a selector drawable in my asset file like this: * 2 different images for 'on'/'off' mode in rest mode (i.e. it does not has focus) * another 2 different images for 'on'/'off' mode in focus mode (i.e. it has the focus). In my case, the rest mode works, but the 'focus' mode does not. Can you please tell me what am I missing in the focus mode? Code...

View 4 Replies View Related

Android :: Is Runtime Mapview Defining Possible?

Jun 26, 2010

I've been trying to use a mapView in my app, and have been following the tutorial; http://developer.android.com/resources/tutorials/views/hello-mapview. Code...

View 5 Replies View Related

Android :: Defining Custom Attrs

Aug 9, 2010

I need to implement my own attributes like in com.android.R.attr Found nothing in official documentation so I need information about how to define these attrs and how to use them from my code.

View 1 Replies View Related

Android :: Make Own UI Defining My Properties?

Jul 8, 2010

How can I make my own UI defining my properties?

View 2 Replies View Related

Android :: Defining Layout Resources In A Modular Way?

Oct 9, 2009

Is there a way to define xml layout resources in a modular way? I am building individual 'panels' through code only, it would probably make sense if each were defined in their own xml file, which I can pull at runtime, something like the following pseudopod: Code...

View 2 Replies View Related

Android :: Defining Width For Spinners Options

Dec 10, 2009

I am using spinners in my application, but when I click the drop down icon the options coverthe entire width of the screen. But I want the options to cover only some part of the screen(ie.. width). By using LayoutParams I am able to change only the spinner icon width but not the options width. I even searched for it,but of no use. Any one help me, I need it very badly.

View 5 Replies View Related

Android :: Defining An XML Vertical Line Drawable

Apr 18, 2010

I'm trying to figure out how to define a verical line (1px thick) to be used as a drawable. to make a horizontal one, it's pretty straightforward: Code...

View 4 Replies View Related







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