Saved State Not Working?

Aug 14, 2012

I am having an issue with Saved state. It is simply not working. I am guessing it is because of the spinner initiation on onCreate but am unsure.

Code:

publicvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Spinner spinner = (Spinner) findViewById(R.id.spnrDenomination);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
this, R.array.denomination_array, android.R.layout.simple_spinner_item);

[code]....

Saved State Not Working?


Android :: Retrieve Saved State Of Custom View In Constructor?

Oct 12, 2009

The "View" instance currently provides a way to retrieve the saved state using the methods below, but there doesn't seem a way to retrieve the view's saved state in the constructor, or onFinishInflate. The custom view is constructed via XML, so I cannot pass the saved bundle from the Activity to the View's constructor.

Relevant methods: - protected Parcelable onSaveInstanceState() and - protected void onRestoreInstanceState(Parcelable state)

I need this because I make an asynchronous network request in a custom view constructor, and if there is a configuration (orientation) change, the custom view is getting reconstructed, and the request is getting performed again. I want to intercept the second request in the constructor. I can do this in the onRestoreInstanceState, but I need to handle this in the constructor.

It would be nice if there was a method such as getSavedState so that the decision can be made in a constructor or onFinishInflate instead of waiting for the onRestoreInstanceState trigger.

View 3 Replies View Related

HTC EVO 4G :: Customized Settings Not (Saved) Working?

Nov 15, 2010

I recently purchased an Evo and have spent the last day getting it up and running, customized etc. I have a few questions I haven't been able to find the answers to yet.

1. Following instructions to conserve battery life, I turned off the email notification light and sound, but every time I get an email it chimes and the light starts blinking. I have reset the phone after making the changed, and when I go into setting it still says the light/sound are off.

2. Similar to #1, I turned off the haptic feedback, but I am still getting it when I use the keyboard. My phone says haptic feedback is off, but when I use the keyboard in the web browser or my contacts, I get the little rumble for each keystroke

3a. Is there any non-warranty breaking way to customize what apps are opened on start up? Every time I turn my phone on I have to go in and taskiller all the sprint nascar, tv, etc crap.

3b. Clicking on taskiller throughout the day, apps I have killed always come back, even when I don't use them, don't have their widget running, etc. This happens with 3rd party apps like tweetdeck, and stuff built into the phone like "news" "music" and others. Is there a way to stop this? Does this stuff (and widgets in general) drain the battery life that much at the end of the day?

4. In the tv ads and in the store and reviews online, everyone made a big deal about Swype and how great it is. All the reviews of it was a big reason why I decided to not get the Epic since everyone was saying they never even touched the keyboard after getting the hang of Swype. Now I have my Evo and I find out that I cant get swype at all? So people suggest a different, similar app, but that one isn't available in the market any more either? What gives? I assumed swype was built into the phone in the first place. I feel a little swindled on this point

5. I have a second domain name attached to my gmail account (i.e. I started out with rift@gmail.com, then later bought rift@rift.com for work). When I am sending emails in gmail, I can choose which domain I want the FROM: field to show. Is there a way to do this on my Evo? I am using the Mail app, not the gmail one (although I could always switch?)

View 2 Replies View Related

Android :: Launching Intent Not Working On Saved Image File

Jun 2, 2010

First of all let me say that this questions is slightly connected to another question by me. Actually it was created because of that. I have the following code to write a bitmap downloaded from the net to a file in the sd card:

// Get image from url
URL u = new URL(url);
HttpGet httpRequest = new HttpGet(u.toURI());
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);
HttpEntity entity = response.getEntity();
BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);
InputStream instream = bufHttpEntity.getContent();
Bitmap bmImg = BitmapFactory.decodeStream(instream);
instream.close();

// Write image to a file in sd card
File posterFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/Android/data/com.myapp/files/image.jpg");
posterFile.createNewFile();
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(posterFile));
Bitmap mutable = Bitmap.createScaledBitmap(bmImg,bmImg.getWidth(),bmImg.getHeight(),true);
mutable.compress(Bitmap.CompressFormat.JPEG, 100, out);
out.flush();
out.close();

// Launch default viewer for the file
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(posterFile.getAbsolutePath()),"image/*");
((Activity) getContext()).startActivity(intent);

A few notes. I am creating the "mutable" bitmap after seeing someone using it and it seems to work better than without it. And I am using the parse method on the Uri class and not the fromFile because in my code I am calling these in different places and when I am creating the intent I have a string path instead of a file. Now for my problem. The file gets created. The intent launches a dialog asking me to select a viewer. I have 3 viewers installed. The Astro image viewer, the default media gallery (I have a milstone on 2.1 but on the milestone the 2.1 update did not include the 3d gallery so it's the old one) and the 3d gallery from the nexus one (I found the apk in the wild). Now when I launch the 3 viewers the following happen:

Astro image viewer: The activity launches but I see nothing but a black screen.
Media Gallery: I get an exception dialog shown "The application MediaGallery (process com.motorola.gallery) has stoppedunexpectedly. Please try again" with a force close option.
3D gallery: Everything works as it should.

When I try to simply open the file using the Astro file manager (browse to it and simply click) I get the same option dialog but this time things are different:
Astro image viewer: Everything works as it should.
Media Gallery: Everything works as it should.
3D gallery: The activity launches but I see nothing but a black screen.

As you can see everything is a complete mess. I have no idea why this happens but it happens like this every single time. It's not a random bug. Am I missing something when I am creating the intent? Or when I am creating the image file? As noted in the comment here is the part of interest in adb logcat. Also I should note that I changed the way I create the image file. Since I want to create a file that reflects an online file I simply download it instead of creating a Bitmap and then creating the file (this was done because at some point I needed the Bitmap but now I do it the other way around). The problems persist thought and are exactly the same:

I/ActivityManager(18852): Starting
activity: Intent {
act=android.intent.action.VIEW
dat=/sdcard/Android/data/com.myapp/files/image.jpg
typ=image/* flg=0x3800000
cmp=com.motorola.gallery/.ViewImage }
I/ActivityManager(18852): Start proc
com.motorola.gallery:ViewImage for
activity
com.motorola.gallery/.ViewImage:
pid=29187 uid=10017 gids={3003, 1015}
I/dalvikvm(29187): Debugger thread not
active, ignoring DDM send
(t=0x41504e4d l=38)
I/dalvikvm(29187): Debugger thread not
active, ignoring DDM send
(t=0x41504e4d l=64)
I/ActivityManager(18852): Process
com.handcent.nextsms (pid 29174) has died.
I/ViewImage(29187): In View Image
onCreate!
D/AndroidRuntime(29187): Shutting down VM
W/dalvikvm(29187): threadid=3: thread
exiting with uncaught exception
(group=0x4001b170)
E/AndroidRuntime(29187): Uncaught
handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(29187):
java.lang.RuntimeException: Unable to
start activity
ComponentInfo{com.motorola.gallery/com.motorola.gallery.ViewImage}:
java.lang.NullPointerException
E/AndroidRuntime(29187): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
E/AndroidRuntime(29187): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
E/AndroidRuntime(29187): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
E/AndroidRuntime(29187): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
E/AndroidRuntime(29187): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(29187): at
android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(29187): at
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime(29187): at
java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(29187): at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(29187): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime(29187): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime(29187): at
dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(29187): Caused by:
java.lang.NullPointerException
E/AndroidRuntime(29187): at
com.motorola.gallery.ImageManager.allImages(ImageManager.java:5621)
E/AndroidRuntime(29187): at
com.motorola.gallery.ImageManager.getSingleImageListByUri(ImageManager.java:5515)
E/AndroidRuntime(29187): at
com.motorola.gallery.ViewImage.onCreate(ViewImage.java:1801)
E/AndroidRuntime(29187): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(29187): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
E/AndroidRuntime(29187): ... 11 more

View 3 Replies View Related

Android :: Custom Listview Background Focus State Not Working

Jun 18, 2010

I am trying to create custom background selector for my ExpandableListView. It works fine for all states other than focused. I am unable to identify which row is currently focused. Here is the code...

View 2 Replies View Related

HTC Droid Eris :: Weather Still Working - Has Long Spelling On State Today

Dec 30, 2009

The default HTC Weather app isn't working today after I restarted my phone after a test.

The Current location 1/2 says Albuquerque, New Mexico. It says "No weather data available"

The 2/2 entry I programed is Albuquerque, NM and that works.

I just added a 3rd Dallas, TX and that works.

Something is odd. It's using the long spelled out state name for the Current location and that doesn't seem to be found in the Weather server when it checks. Just the 2 letter state names seem to work.

View 6 Replies View Related

Android :: Changing Displayed State Of Views Based On Parent ViewGroup's State

Aug 11, 2010

I have a compound UI component built up from a ViewGroup containing a number of TextView, ImageView etc. components. Many of these have StateListDrawables as their images/backgrounds. Is there any way of making them select from this drawable based on the state of the parent ViewGroup rather than the component itself? Ideally I want to be able to change the visual state of all children of the ViewGroup (text colour, image etc) based on the state of the ViewGroup, preferably without having to hook up complex logical code. This seems like a fairly common sort of requirement, so I was hoping it would be straightforward in Android - am I going to be disappointed?

View 1 Replies View Related

Android :: Phone State Listener State Transitions

Feb 8, 2009

I'm a little confused by what I'm seeing with regards to phone state transitions via the PhoneStateListener. When I receive a call, this is what happens: (call comes in) RINGING -> IDLE (I pick up) OFFHOOK (I hang up) IDLE It's that first transition from RINGING to IDLE without any interaction from me (not ending the call, not answering the call) that confuses me. Do I really have to implement an idle counter to know that an incoming call has really ended? Seems like the reported phone state represents some sort of phone state that isn't the obvious one.Is this a bug or am I just not in tune with the paradigm here?

View 2 Replies View Related

Sony Ericsson Xperia X10 :: Forwarding Received Messages / Saved Contacts On Phone / Rather Contacts Saved On Sim Card?

Sep 28, 2010

Please, I need advice on how to get phone numbers saved on the phone up when forwarding received SMS or MMS! At the moment, I can only forward messages to contacts saved on Sim card!

View 5 Replies View Related

HTC EVO 4G :: Attachment Open Not Saved

Jun 25, 2010

Sorry if this has been asked before. Does anyone know when downloading a attachment in email and when completed, you decide to open instead of saving to SD card - does the attachment automatically delete? Or does it get installed into the main memory? If so, how do we delete unwanted attachments?

View 1 Replies View Related

HTC Desire :: Where Does Wallpapers Get Saved?

May 14, 2010

When I crop a wallpaper from a photo where does it get saved so that I can use it again? Used file explorer but can't find it.

View 5 Replies View Related

HTC EVO 4G :: Handcent Settings Not Saved

Jul 1, 2010

Just downloaded Handcent and the settings that I want on it are not saving. For example I want vibrate only when phone is in vibrate mode. That is not working at all. I also disabled notifications in the notification bar and I'm still getting them. Don't know if being on a custom rom (omj) would affect any of this. Pretty annoying though and was wanting to know if anyone else is having this sort of problem. I also rebooted the phone and no dice still.

View 2 Replies View Related

HTC Desire :: Where Are Downloads Saved

Jun 14, 2010

Got my desire today I bought the ultimatejuice for the juice defender app and it installed on the phone , now if i have to wipe the phone can i save ultimatejuice app i paid for so i can install it again.

View 7 Replies View Related

HTC Desire :: Where Are Photos Saved To?

May 17, 2010

I've just got a htc desire and would like to know where photos (taken using the camera) are saved to? i.e. sd card or internal phone memory. Also, when you download attachments where do they go? This is my first Android device. My previous devices have been windows mobile where i could see / choose where attachments, photos etc were saved to.

View 1 Replies View Related

HTC EVO 4G :: Where Mms Pictures Saved At In Storage?

Nov 27, 2010

Got some special pics sent and i wanna make sure i don't loose them ; )

View 4 Replies View Related

HTC EVO 4G :: Can't Open Music Saved On SD Card

Jun 5, 2010

So I moved a good bit of my music to the SD card. When I try to open the playlist and select "all"...it force closes. I had to patch push done this morning that was supposed to fix the SD issue and I haven't had any other problems.

View 1 Replies View Related

HTC Desire :: How Do I Delete A Saved Scene?

Jun 28, 2010

how do you delete a scene you have saved?

View 5 Replies View Related

Android :: Saved Game Files

Feb 24, 2010

Where are 'Saved Game Files' kept? Internal memory or SD Card? Whats the best way to save 'saved games files'? for when I have to do a factory restore or Rom upgrades. For instance Robo Defence which is going to take me years to play and get to level 2000, will still be playing this in my grave, lol. What I was thinking is that I would backup my SD card to my PC, reinstall the game then copy files back from my SD Card or do I have to install a backup App like 'mybackuppro' to specifically back these type of things up?

View 1 Replies View Related

HTC Desire :: MMS Received Files Saved?

Jun 11, 2010

when i receive mms and i save the voiceclip or video, im not too sure where they seem to go? Is there a way of finding out? And I've also noticed that my mms voiceclips dont fully play? Its set to a certain amount of time then cuts off.how can i change it?

View 2 Replies View Related

HTC Incredible :: Change Where Files Are Saved To?

May 5, 2010

I tried to download a different swype version and it said my memory is full! How can this be? even if it's only trying to save on the 2gb micro sd card.I'm pretty sure there's no way I have 2 gigs of stuff on it. I have NO music on my phone and maybe 2 minutes of video 1-2 pics.

View 5 Replies View Related

HTC Incredible :: Where Camcorder Recordings Saved?

Nov 4, 2010

I have an HTC Incredible and can't seem to find where my camcorder recordings have been saved. I want to move them to my computer but can't seem to find them when I look in each of the folders.

View 1 Replies View Related

Android :: Where Selected Wallpaper Saved?

Feb 10, 2009

When a wallpaper is set (either from the Wallpaper Gallery or from Pictures) where is the wallpaper that is selected saved? Is there a directory where this is saved? Is there a Database where this information is saved? who handles this? Is it the wallpaper service? What if I wanted to have multiple wallpapers and have the service rotate through each of them based on some setting - every 1 hour for example - what do I need to change in order to do that?

View 7 Replies View Related

Android :: Preferences Not Saved When Resume App

Jan 22, 2009

I'm having this problem with one of my apps where some people are reporting that their preferences are not being saved when they close and resume the app. The preferences theyre talking about happen to be actual Preferences (i.e. the built-in preferences manager for an activity). They say they're not doing anything special, just exiting the app and going back to it. Does anyone know why the prefs wouldn't be saved for only this select few people? I'm at a complete loss.

View 10 Replies View Related

HTC Desire :: Where Custom Scenes Need To Be Saved?

Sep 24, 2010

Where are the custom saved scenes saved? I want to delete a few that i saved a while ago.

View 2 Replies View Related

Samsung Fascinate :: Where Are MMS Pictures Saved?

Nov 22, 2010

I'm trying to save a picture attached to a text message. I get a message that the picture has been copied to the SD card, but I can't find it anywhere. If I search for it (using Astro), it doesn't find the filename. (stock Fascinate, not rooted)

View 2 Replies View Related

HTC Droid Eris :: How Amazon MP3 Saved Day?

Oct 4, 2010

So I'm at my brother in law's wedding over the weekend and the wedding music cd was basically destroyed. Everyone else had iphone's which didn't have the 3.5 connector to play through the chappel's speaker system. On top of that we were kind of in the middle of no where so their 3g signals were pretty spotty. Luckily my verizon android had a perfect signal so I went on to Amazon mp3 and bought the songs I needed and became the default A/V guy for the ceremony.

View 8 Replies View Related

HTC Incredible :: Where Are Pictures Saved In SD Card?

May 5, 2010

I set my pictures to be saved to sd card, however I can't see the pictures in my computer from my sd card. According to the picture settings in the phone, they should be in /100MEDIA folder but from my computer I don't see them. Where are the pictures being saved in the sd card?

View 11 Replies View Related

HTC EVO 4G :: Saved MMS Pictures Don't Show Until Reboot / How To Fix?

Aug 16, 2010

Just wondering if anyone else has this issue. Happens on all three of my families EVO's. When we recieve a picture message and save it. The picture will not show up in your gallery until you reboot the phone. Anyone else have this issue or know of a fix?

View 2 Replies View Related

HTC EVO 4G :: Saved Bookmarks Disappeared / Can I Get Them Back

Jul 6, 2010

I had around 50 bookmarks saved on my evo and now it says "no bookmarks found "
I tried saving 2 bookmarks after my others disappeared and it's still showing no bookmarks.

View 2 Replies View Related

Android :: Contacts Saved Through Some App Funmobile / What Its Name?

Apr 19, 2009

I got my phone stolen last night

I had all my contacts saved through some app
funmobile
or like fubmobile
I CANT REMEMBER THE NAME.

View 4 Replies View Related







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