[android-developers] Re: AsyncTask and screen rotation

2011-09-22 Thread Bluemercury
Hi there! CAn you share your code for this combination? Right now im using an async task in my parent activity to launch threads, i also have a custom header with a progressbar(indeterminate) where my threads change its state. Right now this seems to be working, but the problem arises when i

Re: [android-developers] Re: AsyncTask and screen rotation

2011-09-22 Thread Bluemercury
How do you something like this: Heres my onCreate of the parent activity: protected void onCreate(Bundle savedInstanceState) { //set theme first for showing correct header setTheme(getThemeId()); super.onCreate(savedInstanceState); themeId=getThemeId(); //in case the screen will have a

[android-developers] Async Task, rotation and indeterminate progressbar in custom header.

2011-09-23 Thread Bluemercury
Hi! So i've been trying to get a solution for a very specific problem that involves using Async tasks and dealing with the rotation and also a custom header that contains a progressbar view(the small spinner one, including a text view saying Loading...). I've followed

[android-developers] Re: Async Task, rotation and indeterminate progressbar in custom header.

2011-09-23 Thread Bluemercury
IS there a way to avoid the static references to the views, but at the same time giving the possibility of the tasks to change the visibility of the progressbar even if the current activity visible is not the one who laucnhed the task initially? -- You received this message because you are

[android-developers] runOnUIThread method in doInBackground of Async Task...

2011-10-03 Thread Bluemercury
Hi! im using an Async-Task and currently im using runOnUiThread in the doInBackground method to refresh activities UI, this seems to be working but on rotation it loses the data and im usng the getLastNonConfigurationInstance and the onRetainNonConfigurationInstance methods, here's the parent

Re: [android-developers] Re: runOnUIThread method in doInBackground of Async Task...

2011-10-04 Thread Bluemercury
The only static variable in use is an int, for maintaining the state of a progress bar while switching activities. the updateResultsinUi() is an abstract method tha is implemented by sub activties classes. regards, -- You received this message because you are subscribed to the Google Groups

[android-developers] AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-25 Thread Bluemercury
So im using an AsyncTask but i'm getting random null exceptions for the activity reference in the doInBackground method. Anyway here's the non inner public async task: public class QuadrosMobileActivityTask extends AsyncTaskVoid, Void, Object{ *protected QuadrosMobileActivity activity=null;*

[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Bluemercury
No one? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options,

Re: [android-developers] AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Bluemercury
yes the detach is called on the activity thread in the onReatainNonConfigurationInstance method...: *@Override* * public Object onRetainNonConfigurationInstance() {* * if(task!=null)* * task.detach();* * * * return(task);* * }* And here's the method that attachs the activity back to the

[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Bluemercury
Well the thing is, this Asynctask is binded to a parent activity, that the subactivities use when they want to do some background work. They each implement the method you see in the code i've posted, the * activity.doBackGroundRequest(); * I've actually had errors even after the line

[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Bluemercury
Also wouldnt using the activity.getApplicationContext() result in the same problem??? if activity is null i would stil lget the null exception??? regards, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to

[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Bluemercury
yes, but how can i get the method from the activity that contains the logic to do in the background from the context, is this possible? im getting null exception for the activity after verifying if the activity is not null: if(activity!=null){ return

Re: [android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Bluemercury
How so? each activity launches its own async task with its own specific logicwhen you rotate you just detach the current activity from the async task, the activity gets destroyed, a new one is created and attached to the SAME async task -- You received this message because you are

[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Bluemercury
Hey Skyler, thanks for the link. so i need to get rid of activity reference on the doInBackground...i assume its possible to use the activity reference in the preExecute and post -- You received this message because you are subscribed to the Google Groups Android Developers group. To post

[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Bluemercury
Hi again skyler, thanks for the reply, yes the code im using in the doInBackground deals with the logic i want to do in the background that each activity has, in this case the method doBackgroundRequest is the method every activity uses if it wants to use an async task...but it seems this

[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-27 Thread Bluemercury
What about extending the async task and then implement the logic directly in the doInbackground method? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe

Re: [android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-27 Thread Bluemercury
Yes i have a indeterminate progressBar in the header, the spinner one, but im using broadcast to all the activities which have the spinner to show or hide it if there's a task running in the background : @Override protected void onPreExecute() {

Re: [android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-27 Thread Bluemercury
Hi there! Yes i removed the code from activity.doBackgroundRequest to the extending Async Tasks doInBackground, i think it might solve this, BUT i will se the thread synchronization topic. Thanks for the attention. -- You received this message because you are subscribed to the Google Groups

Re: [android-developers] AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-11-18 Thread Bluemercury
Hi there! Sorry for posting here again, but i was hoping if i could try this sample, you said to put the synchronized in the detach method here: void detach() { *activity=null;* } in the asynctask, is this correct?but detach() is only called in the activity and not the in the async task

[android-developers] getLastNonConfigurationInstace returns null if task is launched from a Spinner OnItemSelectedListener

2011-12-21 Thread Bluemercury
Hi all! so currently i have an activity that laucnhes an async task from inside the spinner onItemSelected method with the select int year value: spinYears.setOnItemSelectedListener( new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView? item, View arg1, int arg2,

[android-developers] Using Multiple selection List with different events for click in the item list or the checkbox

2012-01-04 Thread Bluemercury
Hi There! So im trying to create a multiple selection list with checkboxes and im using the arrayadapter with the R.layout.simple_list_item_multiple_choice option: public static ArrayAdapter? listMultipleSelectionAdapterArray(List? elements, Context cont){ ArrayAdapter? newAdapter=new

[android-developers] Re: Using Multiple selection List with different events for click in the item list or the checkbox

2012-01-04 Thread Bluemercury
No one?i created a custom arrayadapter but i dont know if i can get all checked items without any connection to the custom row that has the checkbox... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to

[android-developers] Long click in expandable list group items.

2012-02-27 Thread Bluemercury
Hi! im currently using an expandable list as an n-tree level list, and i use the long click to select any element, either group or childs, the problem is that the group row has a gradient gradient backgroup so translates in it not having any kind of highlight. i managed the normal click color,

[android-developers] Re: Long click in expandable list group items.

2012-02-27 Thread Bluemercury
Basically what i want is default behaviour in all states but with my own backgroud gradient:S On Monday, February 27, 2012 2:14:45 PM UTC, Bluemercury wrote: Hi! im currently using an expandable list as an n-tree level list, and i use the long click to select any element, either group

Re: [android-developers] Re: Long click in expandable list group items.

2012-02-27 Thread Bluemercury
/ selected. For those states, your drawable will turn transparent and let the android list item drawable show. You'll also need android:duplicateParentState on the layout added in step 1. -- Kostya On 02/27/2012 06:31 PM, Bluemercury wrote: Basically what i want is default behaviour in all

Re: [android-developers] Re: Long click in expandable list group items.

2012-02-27 Thread Bluemercury
ididnt understand if the new layout would wrap the textview like that. regards, On Monday, February 27, 2012 3:17:12 PM UTC, Kostya Vasilyev wrote: On 02/27/2012 06:57 PM, Bluemercury wrote: Didnt change the row layout like you said, but it seems to be working as expected. Any reason to change

Re: [android-developers] Re: Long click in expandable list group items.

2012-02-27 Thread Bluemercury
, Kostya Vasilyev wrote: On 02/27/2012 07:25 PM, Bluemercury wrote: Hi again Kostya, seems that the cursor focus isnt working althought that's not the most important thing it still is default behaviour so im wondering why it doesnt work. Also the extra layout was something like

Re: [android-developers] Re: Long click in expandable list group items.

2012-02-27 Thread Bluemercury
android:bottomLeftRadius=7dp android:topLeftRadius=7dp android:topRightRadius=7dp / /shape regards, On Monday, February 27, 2012 3:58:51 PM UTC, Kostya Vasilyev wrote: On 02/27/2012 07:53 PM, Bluemercury wrote: Am i missing something the in selector file? regards, Yes - the selector

Re: [android-developers] Re: Long click in expandable list group items.

2012-02-27 Thread Bluemercury
wrote: On 02/27/2012 08:13 PM, Bluemercury wrote: Okay, even after those changes i still get the focus color behind the gradient background. i just putted round corners in the gradient and i can see it behindlet me show what i have now then: Here is my selector: ?xml version=1.0

[android-developers] Converting Custom Dialog to DialogFragment.

2012-03-01 Thread Bluemercury
Hi! So im currently trying to make my custom dialogs persistent after rotation and i was going to use the onCreateDialog method for that. but it seems to be deprecated and instead i was pointed to the DialogFragment class. I've seen some tutorials in android developer page and my main question

[android-developers] out of memory bitmap exceeds VM budget - on Rotation - Theme background reference guilt??

2012-03-07 Thread Bluemercury
So i was having this error after some rotations were made. After this i used the onDestroy method do get rid of drawables: @Override protected void onDestroy() { super.onDestroy(); *unbindDrawables*(findViewById(android.R.id.content).getRootView()); System.gc(); Runtime.getRuntime().gc(); }

[android-developers] onSaveInstanceState method on Fragment not called when corresponding FragmentActivity acts as a tab.

2012-05-22 Thread Bluemercury
Hi! so im currently having a problem regarding the onSaveInstaceState method in the Fragment class. This class is called from a FragmentActivity that acts as a Tab created in another FragmentActivity, but i cant seem to make the call to onSaveInstanceState to happen, here's some code:

Re: [android-developers] onSaveInstanceState method on Fragment not called when corresponding FragmentActivity acts as a tab.

2012-05-23 Thread Bluemercury
/FragmentTabsPager.html On Tue, May 22, 2012 at 10:25 AM, Bluemercury joao.ro...@gmail.comwrote: Hi! so im currently having a problem regarding the onSaveInstaceState method in the Fragment class. This class is called from a FragmentActivity that acts as a Tab created in another FragmentActivity

Re: [android-developers] onSaveInstanceState method on Fragment not called when corresponding FragmentActivity acts as a tab.

2012-05-23 Thread Bluemercury
/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.html or http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabsPager.html On Tue, May 22, 2012 at 10:25 AM, Bluemercury joao.ro...@gmail.comwrote: Hi! so

Re: [android-developers] Problem refreshing a fragment edittext view from a dialogFragment after rotation

2012-06-04 Thread Bluemercury
. Hope this help, Fred On 3 June 2012 01:09, Bluemercury joao.ro...@gmail.com wrote: So im adapting my DateTimePickerDialog implementation to a DialogFragment, and right now it works well, i press the button to show the dialogfragment choose a date/time value, press ok and it will show

Re: [android-developers] Problem refreshing a fragment edittext view from a dialogFragment after rotation

2012-06-05 Thread Bluemercury
Hi al! The thing is here im using framents, the text field is on the fragment, not on the activity itself. The ideia was to create a dynamic dialofgragment without to mess around with the activity too much, since in this case the fragment is part of a viewpager in the activity. What if i use

Re: [android-developers] Problem refreshing a fragment edittext view from a dialogFragment after rotation

2012-06-06 Thread Bluemercury
Hi al! i've read the answer from Dianne, and it seems i can declare an interface in one fragment and then implement it on another. But for this i need the pointer to the fragment in question, she said: take advantage of the FragmentManager APIs to save a fragment pointer in a bundle and

Re: [android-developers] Problem refreshing a fragment edittext view from a dialogFragment after rotation

2012-06-06 Thread Bluemercury
somehow point to the correct edittext regards, On Wednesday, June 6, 2012 2:16:42 PM UTC+1, Bluemercury wrote: Hi al! i've read the answer from Dianne, and it seems i can declare an interface in one fragment and then implement it on another. But for this i need the pointer to the fragment