Android :: Leaked Window In Preference Activity

Jan 30, 2009

I've created a set of preference screens building on the tuts on androidguys. My preference XML contains nested PreferenceScreens. The below doesn't occur in the root screen, only once clicking to a child PreferenceScreen. Once in that PreferenceScreen, even before selecting an EditPreference, if I change orientation (i.e. flick the G1 keyboard out) I get an error: 01-30 09:33:54.080: ERROR/WindowManager(1261): android.view.WindowLeaked: that was originally added here.I have previously overcome this in other activities by utilising the onPause etc methods with custom dialogs I use. How can I prevent this in the PreferenceActivity? What am I missing?

Android :: Leaked window in Preference Activity


Android :: Activity Leaked Window

Oct 2, 2009

Is the 'Activity leaked window' issue (http://code.google.com/p/ beepmystuff/issues/detail?id=3) fixed in any of the latest Android releases? I'm not sure about the Android version I'm using. I get this error during orientation changes. I create PopupWindows inside TextView. When I change orientation when the popupwindow is shown, my log says Activity has leaked a window (popupwindow) and then sometimes the application crashes, but not always. When the application crashes, the log says 'Uncaught handler: thread main exiting due to uncaught exception java.lang.IllegalArgumentException: View not attached to window manager'

View 11 Replies View Related

Android :: Progress Dialog Unable To Add Window In Preference Activity

Jun 17, 2010

I encounter a problem with a ProgressDialog in a PreferencesActivity in my application.What I want to do is pop up a ProgressDialog after the user has changed his username or password during the check on the remote server. In the onSharedPreferenceChanged() I call the ProgressDialog.show() method. Sometimes it works fine, sometimes not at all.

View 2 Replies View Related

Android :: Leaked Window Changing Orientation With SubMenu

Jul 27, 2010

I get a leaked window when I have a submenu visible on the screen and I rotate the screen. If it would be a Dialog I colud call dismiss() in the onStop() before to change the orientation, but with a SubMenu how do I can solve it?

View 5 Replies View Related

Android :: Mangled Preference Activity

Sep 24, 2009

I have pretty unassuming preferences screen based on Preference Activity. (You can see it in DroidIn app) I'm having some problems with it that I think have to do with redrawing the screen after updates. Here are the symptoms: 1. OnPreferenceChangeListener#onPreferenceChange if I change summary of the preference by doing Preference#setSummary the new value is painted over the old one creating unsightly effect 2. My preferences screen is large enough that user has to scroll. While scrolling, the whole screen get all messed up, again it looks like view is redrawn (when scrolled) without erasing the background first.

View 2 Replies View Related

Android :: Preference Activity And AppWidgetId Relation

Jul 4, 2010

i'm using PreferenceActivity class to configure my widget. PreferenceActivity class automatically saves user preferences, so in widget update service i can call context.getSharedPreferences() and i obtain user preferences.Problem is follow: if you have many widget of same type, how PreferenceActivity class saves prefs? how i can load appWidgetId specific prefs from sharedPreferences?

View 7 Replies View Related

Android :: Preference Activity / Multiple Preferences

Nov 4, 2010

Is it possible to use the PreferenceActivity and PreferenceScreen to manage multiple instances of preferences fro a single app? It seems that they store preferences as "default" preferences only. I would like to use a PreferenceScreen as my configure activity for an AppWidget, but I need to be able to store distinct preferences for each widget.

View 2 Replies View Related

Android :: How To Add Fixed View To Preference Activity?

Jul 13, 2010

It occur some problems to develop U/I. there is a PreferenceActivity that was aleady developped and is typecally like 'Settings' of android. by the way, the customer is requiring to change U/I like IPhone.Requirements are

1.application title-bar using ImageView(or TextView) positions to top

2. remove ContextMenu, alternativly static menu buttons positon to bottom.

3. PreferenceActivity is able to scroll and title-bar & menu buttons are fixed each positions.

just all. but It's very difficult to add & fix two views in Preference Activity.

View 3 Replies View Related

Android :: Preference Activity And Theme Not Applying

Apr 11, 2010

I have a problem in the Preferences Activity, in the main preferences the theme shows ok, but if I get to a sub preference, the theme gets messy, it is not white as it should, it is all dark, and the font is black so you can't see much, and when I start clicking on any items they will get sometimes white as they should but revert to black soon after. This is only happens on 2.1, in both the real device and emulator. Tested on the emulator running 1.6 and it was working correctly.

View 2 Replies View Related

Android :: Displaying ProgressDialog Within A Preference Activity

Aug 1, 2010

I've got a quite interesting issue when I try to display a ProgressDialog (the simple, spinner type) within a onPreferenceChange listener.The ProgressDialog shows up, but not until the method (sleep in this case) has finished. What am I doing wrong?

View 2 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 :: Accessing Shared Preference Outside Of Activity

Jul 9, 2010

I need to access the shared preference in a background service instead of activity on phone boot up.But getSharedPreferences function is define in the activity, so how can i access the data without creating the activity?

View 6 Replies View Related

Android :: Preference Change Notifying Main Activity

Nov 13, 2009

I think I've missed something in how Android is supposed to work! I have the main Activity with a menu option that opens the preferences screen. What I need is a way for any changes that were made to be communicated back to the main Activity as soon as the preference is activated. At the moment the only way I could get it working is by using the intent data that gets sent back when the prefs activity closes but this isn't really enough. The reason why it needs to be instantaneous is that one of the preferences is a 'Clear cache' button, so I would like the data to be deleted when the user requests it and no later!

View 4 Replies View Related

Android :: How To Return From Preference Screen To Main Activity?

Oct 14, 2010

I have one main activity and one preference Activity. On my first activity I call menu and go on preference Activity by calling startActivityForResult. Code...

View 1 Replies View Related

Android :: Save Configuration Value As Integer In Preference Activity?

Sep 16, 2010

Is there a way how I can tell the Preference Activity that value should be saved as integer? So far my all values are saved as strings... I can limit input to integers via XML easy:

<EditTextPreference android:key="SomeKey" android:numeric="integer" />

but it is still saved as string and later trying to getInt("SomeKey") on preferences object I always get java.lang.ClassCastException: java.lang.String.

Is there a way that EditTextPreference value would be saved not as string? Or maybe I should use some other type of Preference for numeric input?

View 7 Replies View Related

Android :: Public Class Preference Extends Activity - Null Pointer Exception

Jun 19, 2010

My app crashes with a null pointer exception on the code below. I have an xml preference file under res/xml/defaults.xml
public class Preference extends Activity {
public Preference() {
} public String getPreference(String key)
{ //it still crashes here
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());
String result = settings.getString(key, null); return result;
} }

View 4 Replies View Related

Android :: How To Capture Key Events With Window-less Activity?

Dec 2, 2009

I have an Activity which has no window (but it has a view). I'm using: getWindowManager().addView(view, params);I've attempted to call takeKeyEvents(true), however I see that takeKeyEvents first retrieves the Window and then calls takeKeyEvents on that Window.In my case, the Window is null.What this means is that I never receive onKeyUp and onKeyDown calls, which I need in order to intercept some key presses from external input devices (similar to a handsfree set for example).

View 10 Replies View Related

Android :: Create Transparent Window Without Starting A New Activity?

Mar 19, 2009

I have a 2D app. When the user presses a button, I need to quickly open a translucent 3D animation and overlay that on top of the 2D app. This is similar to the "Translucent GLSurfaceView" demo in APIDemo.

However, with APIDemo on G1, it takes about 100~200ms for the new Activity to come up. For me, this is too long. Is there any way to make it faster (to about 30~60ms).

My idea is to create a transparent Window object that contains a SurfaceView and hide it. When user presses button, the Window is shown.

View 2 Replies View Related

Android :: Starting Activity Witouth Window From Widget

Apr 17, 2010

I recently (yesterday in fact :)) started creating widgets.

So my first widget I want to create is something like: * A 2x2 widget * Containing 2 buttons * Button

1: Register current time and location * Button

2: Open up an activity where configuration can be modified, registered times and location can be viewed,...

Now the problem for me is button 1. As I only try to do some registration data (so no further user input required after pressing the button) I would like to just show a loading bar and after wards Toast a message to screen, or a popup if anything goes wrong.

This is what I do now:

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

So what happens: I click the button, a plain black screen pops up (Altough I did not specify a layout upon creating the activity), and after my work is done the Toast shows up and the activity gets 'killed'. Basically that is what I want to do except for the black screen to show up. Is it possible not to show a screen upon creating the activity?

View 2 Replies View Related

Android :: ActivityGroup - Embedded Activity Search Window

May 27, 2009

I have an ActivityGroup with an embedded TabActivity and another simple Activity.

The TabActivity has three tabs, each one with a ListActivity.

When I try to start a search from a list (calling onSearchRequested()), I get a WindowManager$BadTokenException.

I've tried requesting focus in the list, but the same error occurred.

View 4 Replies View Related

Android : How Can I Get A Dialog Style Activity Window To Fill Screen?

Sep 1, 2009

I am using an activity with the dialog theme set, and I want it to be full screen. I tried all sorts of things, even going through the WindowManager to expand the window to full width and height manually, but nothing works. Apparently, a dialog window (or an activity with the dialog theme) will only expand according to its contents, but even that doesn't always work. For instance, I show a progress bar circle which has width and height set to FILL_PARENT (so does its layout container), but still, the dialog wraps around the much smaller progress bar instead of filling the screen. There must be a way of displaying something small inside a dialog window but have it expand to full screen size without its content resizing as well?

View 2 Replies View Related

Android :: Get Shared Preferences From A Preference Activity In Android?

Apr 10, 2010

I am using a PreferenceActivity to show some settings for my application.I am inflating the settings via a xml file so that my onCreate (and complete class methods).These preferences will automatically save to SharedPreferences as the user interacts with them. To retrieve an instance of SharedPreferences that the preference hierarchy in this activity will use, call getDefaultSharedPreferences(android.content.Context) with a context in the same package as this activity.

View 4 Replies View Related

Android :: Preference Activity Not Showing Twice On Android

Apr 10, 2010

I've a Preference Activity which works perfectly the first time i launch it.But if i close it ( with the back button ) and then i re open it ( through a menu click in the main activity ) then i get a black screen. There is no preferences at all.I can't figure it out why it should not working.It seems all the code is being called normally as the working one but no preferences are showing on the screen.

View 1 Replies View Related

Android :: I Can't Get Rid Of This Error Message: Activity <App Name> Has Leaked ServiceConnection <ServiceConnection Name>@438030a8 That Was Originally Bound Here

Jan 2, 2010

I'm working on my first Android app, so I apologize if this is extremely obvious. I've got three activities in my app, and the user switches back and forth pretty frequently. I've also got a remote service, which handles a telnet connection. The apps need to bind to this service in order to send/receive telnet messages.

I have re-written my code in light of your clarification on the difference between using bindService() as a stand-alone function or after startService(), and I now only get the leak error message intermittently when using the back button to cycle between activities.

My connection activity has the following onCreate() and onDestroy():

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

So the service is started when the activity is started, and stopped when the activity is destroyed if no successful telnet connection was made (connectStatus == 0). The other activities bind to the service only if a successful connection was made (connectStatus == 1, saved to a shared preferences). Here is their onResume() and onDestroy():

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

So the binding happens in onResume() so that it will pick up the changed state from the connection activity, and in the onDestroy() function it is unbound, if necessary.

But I still get the memory leak error message "Activity has leaked ServiceConnection @438030a8 that was originally bound here" intermittently when switching activities. What am I doing wrong?

Full error message follows (from the revised code):

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

I did as you suggested and added an onUnBind() override to the service. onUnBind() is actually only triggered when all clients disconnect from the service, but when I hit the home button, it executed, then the error message popped up! This makes no sense to me, as all the clients have been unbound from the service, so how could the one destroyed leak a serviceConnection? Check it out:

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

I thought it might be something like you said, where the binding to the service is not complete when unbindService() is called, however I tried calling a method on the service as I backed through each activity to verify that the binding is complete, and they all went through fine.

In general, this behavior doesn't seem related to how long I stay in each activity. Once the first activity leaks its serviceConnection, however, they all do as I back through them after that.

One other thing, if I turn on "Immediately destroy activities" in Dev Tools, it prevents this error.

View 3 Replies View Related

Android :: Downloader Activity - After Downloader Has Completed Window Disappears And Nothing Happens

Jan 1, 2010

I have integrated the downloader activity (Google provided) into my application.. On the whole a very straight forward process. A problem I have though, is, after the downloader has completed the window disappears and nothing happens. If I hold down the HOME key I see my app and if I click on it my appss window comes up and runs correctly. Also when I run it subsequently it works correctly. Has anyone else experienced this? It certainly looks like the downloader should trigger my app when it is done; I am not sure if the window is just not getting focus or someething. It is a fullscreen GL app.

View 2 Replies View Related

Android :: Difference Between Phone Window And Mid Window

Sep 1, 2010

What is the basic difference between the PhoneWindow and MidWindow policies? I found that the emulator version takes the implementations of the PhoneWindow.When the MidWindow implementations will be used? Also, I found that PhoneWindow handles the call settings implementation and the same is not there in MidWindow? Please someone help me pointing out the differences between both the policies and under which circumstances which one will be used.

View 6 Replies View Related

Android :: What Window.demo.clickOnAndroid() - Window And Demo?

Feb 7, 2010

<html>
<script language="javascript">
/* This function is invoked by the activity */
function wave() {
alert("1");
document.getElementById("droid").src="android_waving.png";
alert("2");
}
</script>
<body>
<!-- Calls into the javascript interface for the activity -->
<a onClick="window.demo.clickOnAndroid()"><div style="width:80px;
margin:0px auto;
padding:10px;
text-align:center;
border:2px solid #202020;" >
<img id="droid" src="android_normal.png"/><br>
Click me!
</div></a>
</body>
</html>

What is "window.demo.clickOnAndroid()"? I know that clickOnAndroid is a method in my Android application. But what is window and demo? My file is called demo.html. Is that it?

View 2 Replies View Related

Android :: First Run Preference Initialization

Feb 15, 2010

I have next situation: After installing application it has to init settings from server. And while it is not has right preferences it has to wait. I have several receivers and service - I don't want to check for initialization in every action in these components - I think there have to be better solution.

View 3 Replies View Related

Android :: How To Get Specific Preference And Set Its Value?

Sep 23, 2010

I have the following code in my application in res/xml/preferences.xml:

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="Wi-Fi settings">
<EditTextPreference
android:key="pref_voice_threshold_top"
android:title="@string/title_pref_voicetopthreshold"
android:dialogTitle="@string/dialog_title_pref_voicetopthreshold"
android:defaultValue="20" android:inputType="number"/>
</PreferenceCategory> </PreferenceScreen>

And I was wondering is it possible for me to then use this preference in code so I can update it via downloading an xml file? So I currently display the above preference in a PreferenceActivity, which works fine, however I want to be able to update the setting by downloading a new setting every week from the internet. So my question is how do I open this preference in code and set its value to the new downloaded value?

View 2 Replies View Related

Android :: How To Set Preference In Code?

Feb 16, 2009

I have an Android application in which I have my preferences in a xml file, which works fine. I've now want to set one of the preferences using code instead of displaying the entire preference screen, how would I go about doing this?

View 1 Replies View Related







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