Android :: Explicit Intent In Custom Preferences Screen
Aug 19, 2010
I'm currently using this in preferences.xml: .......................
This allows to trigger a custom Activity when this specific preferences item is triggered. Copying from the documentation, I'm using an implicit intent, and it's working. But I'd solve a problem if I could use an explicit intent, that is writing the fully qualified class name of the target Activity. I didn't find documentation about this, so I don't know whether it's possible and how to do that.
View 2 Replies
Mar 16, 2010
Is it possible to receive an explicit intent with the component option set? Example: Starting activity: Intent { action=android.intent.action.VIEW data=http://example.org flags=0x10000000 comp={com.android.browser/com.android.browser.BrowserActivity}}
The reason why i want to this this is because i want receive this intent above, launch another browser than the default one, and drop the intent before it starts the default browser. In another words, i want to make another browser the default one.
View 1 Replies
View Related
Apr 22, 2010
I am using a PreferenceActivity to let the user set some values. I am feeding it the xml file with the defined preferences.
I have set all the android:defaultValue="" for them.
When I start my application, I need the preferences, or if they are not set yet manually, I want the default values:
CODE:.................
However, when android:defaultValue="true" I still get false. So, it looks like the defaultValues set in the XML are not used anywhere but when initializing the preferences-screen.
I don't want to hardcode the default values in the getBoolean() method. So, is there a way get the default-values with only defining these in 1 place?
View 2 Replies
View Related
Mar 7, 2009
My app needs to have a intent-filter that responds to a intent that has it's component set (a explicit intent.) Here is a example.
Intent i = new Intent();
i.setClassName("com.compareeverywhere","com.compareeverywhere.ScanActivity");
startActivity(i);
Just a simple intent-filter will not do - because the intent is made for a specific component (activity,) it just launches that without looking for intents at all. Is there a way to do this?
View 1 Replies
View Related
Jan 17, 2010
I'm launching activity from preferences screen. Activity is shared among three preferences.
I wonder if i can set extras for this activity in xml. code...
All i need to do to pass an integer really. I can different actions and check action instead of extras.
View 5 Replies
View Related
Jan 21, 2009
In a preferences screen in my application which is build by extending the PreferenceActivity i need to change background on the window itself and on the PreferenceCategory. How i can do it via Themes/Styles ? Which attributes i need to define ?
View 3 Replies
View Related
Nov 2, 2010
I'm trying to remove a preference from the screen so it isn't visible if the user is using an SDK greater than 2.2. I've found several answers saying that getPreferenceScreen().removePreference(thePreference) will work, but I'm getting FALSE returned every time I try it. Am I using it in the wrong place?
Any clue from my code?
CODE:.................
View 2 Replies
View Related
Mar 19, 2010
My application is used on multiple platforms so it saves it preferences to a file (rather than to the standard Android SharedPreferences).
Is there any easy of reusing the PreferenceActivity to save preferences to a file or is it a case of creating a whole new activity to do the job? If the latter is the case is there a layout I can use that will make the activity look like the normal preferences screen? PreferenceActivity uses com.android.internal.R.layout.preference_list_content but this doesn't appear to be available to apps for reuse.
View 2 Replies
View Related
Jul 25, 2009
I'm building a service that sends a broadcast intent when some value changes. The service sends the broadcast like this:
Intent broadcastIntent = new Intent(); broadcastIntent.setAction("nl.vu.contextframework.NEWREADING"); broadcastIntent.setData(Uri.parse("context://"+cer.getKey())); broadcastIntent.putExtra("reading",cer); broadcastIntent.addCategory("nl.vu.contextframework.CONTEXT"); sendBroadcast(broadcastIntent);
In some Activity (in a different process), I'm tryint to receive this broadcast as follows:
IntentFilter intentFilter = new IntentFilter();
intentFilter.addDataScheme("context");
intentFilter.addCategory(CATEGORY_CONTEXT);
registerReceiver(new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
Log.d(TAG,"Received intent "+intent); }
}, intentFilter);
View 6 Replies
View Related
Jul 25, 2010
I want to specifically run the default Android browser for a given URL. I'm using this code: I also tried adding <uses-library android:name="com.google.android.browser" /> to the manifest. Am I missing something here? PS: I'm not interested in using startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"))) as it will list all the choices for the browsing Intent.
View 3 Replies
View Related
Feb 7, 2014
just wondering if there was any way to set per-app preferences for a secure lock screen with a pin entry. For example, i don't care if my google-music lock screen widget works while the phone is locked (and having to enter my pin every time I want to go forward or back a song sucks. That's just an example? Root-only options are welcome as well.
View 1 Replies
View Related
Oct 26, 2010
on my pim you can only set a reminder alarm as an offset from the event date/time and not as a specific date/time for the alarm itself
View 21 Replies
View Related
May 26, 2010
Working with android I realized that implicit intents are good choice in most of cases due to their's flexibility. But what's about explicit intents? What are benefits of using them? What are common cases when it's a good practice to use them?
View 1 Replies
View Related
Jun 27, 2010
This questions somehow relates to the question when I was looking to get the extras back in startActivityForResult but now I face another challenge.
I have subscribed to receive ProximityAlerts and I have explicitly constructed the Intent to include some Extras. But when I got the service the extras are not there.
After the answers here is the working code:
CODE:..........................
The documentation says param PendingIntent to be sent for each location update.
View 2 Replies
View Related
Dec 16, 2012
Is it possible to create a shortcut for network preferences in home screen
As i use that option frequently, each time i have to go to settings-->more-->mobile networks-->Network preferences
View 1 Replies
View Related
Aug 29, 2010
Was trying to call another application using an *explicit* intent, but am finding it does not seem possible. I do not wish to use implicit intents. To test it out, try calling the YouTube main activity.
Intent i = new Intent(); ComponentName cn = new ComponentName("com.google.android.youtube","com.google.android.youtube.HomeActivity.class"); i.setComponent(cn); startActivity(i);
I get this error:
08-29 00:54:26.598: ERROR/AndroidRuntime(7332): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.google.android.youtube/ com.google.android.youtube.HomeActivity.class}; have you declared this activity in your AndroidManifest.xml? Does anyone know whether this is possible? (using explicit intents to call another application)
View 3 Replies
View Related
Sep 30, 2009
I have some code that starts another activity based on a menu item selection:
..........
I've spent quite a bit of time on this and am inclined to file a bug report at this point. I can see a reference to the allegedly missing class in the classes.dex file inside the APK and the code works properly in the emulator. I haven't been able to find anything like this, so if there is, an RTFM pointer will be humbly accepted.
View 4 Replies
View Related
Aug 22, 2010
The error I receive is, "android.content.ActivityNotFoundException: Unable to find explicit activity class {com.droidea.birthday/ EditBirthdayActivity}; have you declared this activity in your AndroidManifest.xml?"
The error seems simple enough, but I don't see a problem with the way I have identified this activity in my manifest file. I have also been unable to see any problems with the activity class itself..............
View 4 Replies
View Related
Jun 23, 2010
My android application has two kinds of preferences:
1) I have user preferences defined in res/xml/preferences.xml so that users can manage their preferences with a PreferenceActivity.
2) I'd like to define another file for global configuration preferences of my app.
What is the best way to manage my app config preferences? Should I create another XML file with config values or should I specify those config values in strings.xml? What is the best practice for managing config preferences?
View 3 Replies
View Related
May 26, 2010
I have a service which starts at boot up time, the service code needs the intent of following scenarios.
1) When the phone locks(after time out)
2)When the user unlocks the screen (by dragging the screen lock object)
There doesn't appear to be an API available where an application can be notified when the device is locked or unlocked. It is important the this application be notified of these events, since the service utilizes the proximity sensor which does not shutdown when the device goes into suspend. The app will need to unload the prox sensor manually to save battery when the device gets locked, and reload the prox after the device is unlocked again.
View 3 Replies
View Related
Mar 26, 2010
When I use a RelativeLayout with either fill_parent or wrap_content as height and an element which specifies: android:layout_alignParentBottom="true" it is ignored and it is aligned at the top. Setting the height of the RelativeLayout to an explicit value makes it work.
View 3 Replies
View Related
May 10, 2010
Is there an intent that is fired when a user unlocks their screen? I want my app to adjust the brightness when the screen turns on, but the problem im running into is that the screen on intent is fired on the lock screen and it does not adjust the display on that screen.
View 1 Replies
View Related
Nov 8, 2010
I am attempting to add a simple preferences file in a new Android project (New -> Android XML File), but it doesn't appear to be working correctly.
There is no root element to choose from when I select the Preference type layout. If I press Finish, it doesn't do anything. See screenshot below.
View 3 Replies
View Related
Jun 9, 2010
I have seen the below log message when navigating to the Account & sync settings screen but I am confused as to how to create an Intent to navigate there.I dont seem to have access to the ManageAccountsSettings for development.I just wanted to create an Intent such as below, but I cant call out ManageAccountsSettings.
View 1 Replies
View Related
Feb 18, 2010
We are looking to add a new android locking screen (a password based one) with the same behaviour of the current unlock pattern. With some ugly hacks we have been able to create a custom locking screen but we haven't found a way to disable the home key.
View 3 Replies
View Related
Feb 18, 2010
We are looking to add a new android locking screen (a password based one) with the same behaviour of the current unlock pattern. In fact we have been able to create a custom locking screen but we haven't found the way to disable the home key.
View 2 Replies
View Related
Sep 16, 2010
How do I write a custom screen locker? Where is the source of the default screen locker? Any links on writing custom screen lockers?
View 3 Replies
View Related
Jun 11, 2009
I love the SlidingDrawer widget, but would love to be able to have it slide down from the top of the screen (like the notification bar) vs. just the bottom. Is this possible, or am I looking at copying the code to create a custom implementation
View 2 Replies
View Related
Mar 31, 2010
For example, I want to write an activity that launches when you return from sleep (black screen). How can I set this activity to run instead of the default one? In other words, I want to make a custom lock screen.
View 1 Replies
View Related
Sep 30, 2010
I've downloaded the source for both google's default home screen and adw. I created a project in Eclipse and used those sources. However, I can not compile the code as there are quite a few errors. Does anyone know how to do this correctly? Do I need to add all of the google code to my project?
(I asked the same question in another thread, link text )
View 1 Replies
View Related