Android : Opening Phone Deletes App State

Jun 10, 2010

I'm writing an android application that maintains a lot of "state" data...some of it I can save in the form of onSaveInstanceState but some of it is just to complex to save in memory.

My problem is that sliding the phone open destroys/recreates the app, and I lose all my application state in the process. The same thing happens with the "back" button, but I overloaded that function on my way. Is there any way to overload the phone opening to prevent it from happening?

Android : Opening phone deletes app state


Android : Spontaneously Shut Down From Opening An App - Reboot Into A Frozen State

May 9, 2010

Hi, I have a pretty ordinary g1. Htc dream, unlocked (ATT is my provider). Well, I installed cyanogenmod a few weeks ago and it worked out great. I also did the 10 MB RAM hack.

Then I got greedy. I thought I'd partition the sd card and cyanogenmod would start installing apps to the sd card. This turned out to be a disaster. Probably I didn't do it right.

Everything was fine for a few days, seemed faster, etc., until I installed a new app. It was the first app installation since partitioning. Suddenly, there were problems with ALL my apps. I then thought, well uninstall app x that you just installed, but alas, I couldn't, as it wasn't listed as installed.

The phone would even spontaneously shut down from opening an app. In short, the phone became very scary and very unusable. After spontaneously shutting down, it would reboot into a frozen state, etc.

So I reformmated the sdcard, and redid cyanogenmod. I thought that this would simply undo the partitioning that I'd done, and I'd be back to where I was with a pretty good g1.

Well, cyanogenmod went okay, but there were still lots of problems. So I did a factory reset, and cyanogenmod again. This was slightly better, but it's still touch and go with my g1 now.

Home process needs force close, reddit is fun will sometimes not work. Sipdroid, even Android market, when I click it, does nothing. Sometimes when I plug the phone in with a USB cable, I mount it from the phone and it will suddenly unmount itself. Wont stay mounted.

Each of these problems will go away with rebooting, but now I've rebooted my phone maybe 30 times in the past two days. Not to mention uninstalling, reinstalling apps and rekeying in usernames and passwords, etc.

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

Motorola Droid :: Phone Randomly Deletes All SMS Message Threads

Feb 16, 2010

Today I got a text, opened it up, and all I got was an empty list of all my messaging threads. Everything was erased. Does anyone know why this would happen, and if there is any way to recover the texts?

View 3 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 :: Opening Phone Email Application From Another One

Oct 6, 2010

I have my application which creates an audio file. I need to forward this file via Android Email app. But on calling the email intent, I get a permission denial. I am calling the email app like this:When I am launching the app, I get this "Not granting access" message in the ddms logs: WARN/PackageManager(90): Not granting permission com.android.email.permission.ACCESS_PROVIDER to package com.mplayer.application (protectionLevel=3 flags=0xbe44) Can I not open the android email app from my application. I am working on Android 2.2.

View 6 Replies View Related

Android :: Way To Get Favorite Contacts When Opening Phone?

Oct 5, 2010

I don't know if this is phone-specific. I have a Sprint HTC Hero. When I press the phone button, I get the call log, and then I can click over to Favorites to get my most-used contacts. It would be perfect if when I click on the phone button, it would default to my favorites instead of the call log. Is this possible?

View 8 Replies View Related

Android : Opening A Url In The Phone's Default Browser

Jul 8, 2010

I'm trying to make test-program that opens a website by pushing a button. I have made a listener and everything, my problem is just that, the url-opening-script makes an error and tells me "Uri cannot be resolved".

Here's the script I use to open up an webpage:

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

I have the import android.app.Activity;, import android.content.Intent; and import android.content.ContentUris; (maybe the last one isn't needed) so I can't find out what's wrong...

I hope someone knows what I've done wrong, or forgot to import...

I've used this pages to get to where I am:

http://stackoverflow.com/questions/2201917/android-open-url-from-code
[url]

View 1 Replies View Related

Android :: How To Save App State In Phone?

Aug 30, 2010

I am writing an app where I get all the data from the rest call and display all the data in a custom component list(based on Linear Layout) which is added to a LinearLayout. I write this code in onCreate of the activity. The problem is when I switch activity using startActivity, and come back to the calling activity (using startActivity) then onCreate is called again. I see onPause, onStop called when I call other activity. Is there any way that I can save the application's state?

View 1 Replies View Related

HTC EVO 4G :: Voice Phone Dial Randomly Opening - Music Tracks Skipping Around - Phone Acts Possessed

Jun 11, 2010

I've noticed this since I bought the phone (I had other issues before such as low battery life, vibration feedback simply not working, etc - I hard reset the phone and those went away, but this is back), and I'm wondering if it's my hardware, or the software.

Basically, if I'm listening to music (Pandora or the Music app), it'll randomly hit Next song - if it's the music app, it'll be a mish-mash of fast forward and next track. This is with the phone screen off or on. When it starts happening I turn the screen on and notice it jumping all over, and I've not touched anything. Additionally, while this is happening, voice dialer opens over and over after I close it, and sometimes it'll just start making a call to the last dialed/received number (which is making me a hit with all my friends).

Finally, I say possessed because this is not consistent. For example, I'm listening to Pandora now with no issues. However, the fact that I have to even worry about this happening again (it's almost surefire in the car, for some reason, but not exclusive to there) is a dealbreaker, and my 30 day trial is still going, so I should probably decide.

View 10 Replies View Related

Android :: Using Broadcast Intents / Phone State Changes

Jun 29, 2010

I was just working on an application that will do stuff when a call is missed or made; and am left wondering why do you have to register a listener using a long lived background service for phone state changes instead of being able to use broadcast intents?

View 2 Replies View Related

Android :: Read Phone State And Identity?

Feb 27, 2010

For applications that set the android.permission.READ_PHONE_STATE permission. What is meant by "identity" in the permission description "read phone state and identity"? Users ask about this and we don't know what to tell them...

View 5 Replies View Related

Android :: Need To Allow State Of A Correct Phone Call

Oct 14, 2009

I can see that we can get a phonestate via the PhoneStateListener, but there is no way of telling the state of the call. OFFHOOK is a number of states combined into one. Is there a particular reason for this? Are we not allowed to see the correct state of a call?

View 2 Replies View Related

Android :: How Do I Get State Of Outgoing Call In Phone?

May 20, 2010

I noticed in the class TelephonyManager there are CALL_STATE_IDLE, CALL_STATE_OFFHOOK adn CALL_STATE_RINGING. They seem to be used for incoming calls.What I actually want to do is to be notified when an outgoing call is made, is received, or timed out. How to do that?

View 2 Replies View Related

Samsung Behold 2 :: Killed My Phone - Restore This Phone Back To Its Original State?

Apr 20, 2010

I was trying to root my samsng behold 2 earlier today using the command codes on theunlockr.com. I thought everything was going well as I went all the way to the last step where it rebooted my behold 2. Problem is, the phone kinda just turned off after doing the reboot command and didn't turn back on by itself (I gave it like 10 minutes). I eventually then just turned on the phone manually and noticed that everything was super laggy. Even when I used taskkiller to kill every task minus GDE, it said I only had 38MB ram available. I rebooted my phone a few times and it was laggy everytime so I decided to do a hard reset. The problem is that when I attempted the hard-reset, it will now get stuck on the samsung screen when trying to load up (stayed there for over 30 minutes). I can still enter the phone if I just start it up regularly without trying to hard-reset, but it will continue to be VERY laggy.

Is there anything I can do to restore this phone back to its original state? I was reading about using ODIN to flash it or something, but for some reason my computer doesn't detect my phone when I go into Download mode on startup (it does however detect the usb drivers on my phone once the phone officially startsup into its homepage).

View 7 Replies View Related

Android :: Database Randomly Deletes Itself So Often

Jun 28, 2010

I have a normal SQLite database in my app, managed through my own ContentProvider and implemented via SQLiteOpenHelper. On the Droid only, every few weeks or so, the database just disappears. I have several users who wrote me about that, and I've seen it myself too now. I added some debug info (hard to repro when you only see it every few weeks), and in one instance, it just happened inbetween widget updates - first, the widget is displayed and shows the data just fine, the next time, the SQLiteOpenHelper's onCreate is called.

The app itself does some multi-threaded shenanigans, but all ContentProvider implementations have the synchronized keyword, all access to the database is via the content provider and in the instance described above, there is no multi-threading going on (the app itself hadn't been running, just the widget). And again, this is only on the Droid. I've never seen it on the G1. I never close the database, but it being a content provider, it sounds like I'm not supposed to do that in the first place (I remember hackbod saying that the idea is that the OS will close the app's process when necessary, which will automatically close the database).

View 1 Replies View Related

Android :: Phone State Listener Memory Leak

Sep 8, 2009

There appears to be a leak when using PhoneStateListeners. The following code simply reigsters in onResume and unregisters in onPause a PhoneStateListener. Repeatedly launch then press BACK (so the app is finished & onDestory is called before the next launch) and the number of activities reported by meminfo will equal the number of launches. For instance, here is the output I get after launching (and finishing) 11 times in sequence:

dumpsys meminfo com.example.leak Currently running services: meminfo
DUMP OF SERVICE meminfo: Applications Memory Usage (kB): Uptime: 12204322 Realtime: 12204322

** MEMINFO in pid 1358 [com.example.leak] ** native dalvik other total size:
2648 3079 N/A 5727
allocated: 2604 2254 N/A 4858
free: 43 825 N/A 868
(Pss): 913 1305 1475 3693
(shared dirty): 1080 3864 568 5512
(priv dirty): 808 936 1056 2800

Objects Views: 77
ViewRoots: AppContexts: 12
Activities: 11
Assets: 2
AssetManagers: 2
Local Binders: 36
Proxy Binders: 21
Death Recipients: 0
OpenSSL Sockets: 0
SQL heap: 0
dbFiles: 0
numPagers: 0
inactivePageKB: 0
activePageKB: 0 #

Without the PhoneStateListener, the number of activities is always 1 no matter how many times the app is launched & finished. So, am I doing anything wrong here? Or is this a bug in the TelephonyManager?

Here's the code package com.example.leak;

import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.util.Log;
public class LeakExample extends Activity {
private class MyPhoneStateListener extends PhoneStateListener {
@Override public void onCallStateChanged(int state, String incomingNumber) {
if ((state == TelephonyManager.CALL_STATE_RINGING)
|| (state == TelephonyManager.CALL_STATE_OFFHOOK)) {
LeakExample.this.finish();
} } }
MyPhoneStateListener phone_listener = new MyPhoneStateListener();
TelephonyManager telMgr ;
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
telMgr = (TelephonyManager) getSystemService (Context.TELEPHONY_SERVICE);
} @Override protected void onPause() { super.onPause();
telMgr.listen(phone_listener, PhoneStateListener.LISTEN_NONE);
} @Override protected void onResume() { super.onResume();
telMgr.listen(phone_listener, PhoneStateListener.LISTEN_CALL_STATE);
} @Override protected void onDestroy() { super.onDestroy();
Log.v("LEAK EXAMPLE", "onDestory");
}

View 3 Replies View Related

Android :: Application Read Phone State And Identity?

Dec 6, 2009

Anyone know what providing an application access to "Phone calls: read phone state and identity" actually does?

View 5 Replies View Related

Android :: Telephony Manager & Phone State Listener

Sep 7, 2010

I would like to know what are the main differences between TelephonyManager and PhoneStateListener, because you can do (more or less) the same things with both. For example, you could create an incoming calls register implementing a broadcastreceiver and using TelephonyManger API or extending PhoneStateListener class and registering this new listener throughTelephonyManager . Case 1 - BroadcastReceiver (TelephonyManager)

View 13 Replies View Related

Android :: Notify Service From Phone State Listener

Mar 19, 2010

I have built an application that listen to call state changes, and I want to notify a service when the call_state became IDLE.All the components I have are functional, I just need to notify (not start) a service for this.What's the correct practice, maybe using AIDL? Because, in a PhoneStateListener, I can't bind to a service. Do I have to start an activity for that?

View 2 Replies View Related

Android :: Phone Won't Save Current State Of An Activity / Way To Do

Nov 17, 2010

I am trying to save some values in the onSaveInstanceState(Bundle) method of my activty by following the example here: How do I save an Android application's state?

But it doesnt seem to load it from the Oncreate(). the bundle object is always null but whenever i call another activity, it does indeed go into the onSaveInstanceState method to save my values.

Now i read that question i just posted and someone noted how they could not get it to work in an emulator? unfortunately that is all im working on. On an emulator and cant test the app on the device as i have no device available to me right now And the web services i am interacting with are in a local VM on my work machine that cannot be accesses remotely at the moment.

My question is, is it true that saved bundles dont work on emulators? I also noticed how when i do dismiss or bring up a new activity , the activity calles onPause and then onStop. when i bring back the same activty, it goes straight to onCreate?

now according to the docs here http://developer.android.com/guide/topics/fundamentals.html#actlife That is correct in terms of what the lifecycle diagram shows but if you read below that diagram on the onStop() section it says the next step it goes into is either onRestart() or onDestroy()? no mention of onCreate? Type on the docs?

Anyways here is my onSaveInstanceState() and onCreate() both in the same activity: code...

View 1 Replies View Related

Android :: Error With Listening To Phone State Listener In Service

Nov 11, 2009

I have a BroadcastReceiver that listens for the BOOT_COMPLETED, that part works I know because I disabled my phone listener and displayed a Toast within. That BroadcastReceiver is supposed to start a service, that also works. I run into Force Close issues when my service attempts to tell my TelephonyManager to listen. Any one have any ideas? Here is my code StartSeviceAtStartUp.java import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent;

View 3 Replies View Related

Android :: Reregister Phone State Listener If Application Crashed

Nov 17, 2009

i've registered a PhoneStateListener in BOOT_COMPLETED receiver by using following call: tm.listen(new TestCallStateListener(), PhoneStateListener. LISTEN_ CALL _STATE); If the application crashes then system automatically unregisters the PhoneStateListener. Is there any mechanism of checking if particular PhoneStateLister is registered or not? Actually i'm thinking of starting a repeating service by AlarmManager which will check if PhoneStateListener is registered or not . And if it's not registered then service will register it again. Just a backup if application crashes. Is this a good approach or there is some better mechanism to make sure that PhoneStateListener is always registered even if application crashes ?

View 2 Replies View Related

Android :: Phone State Listener Events Stop Receiving Sometime

Jan 21, 2010

My application process incoming/outgoing calls and shows some UI. So I use PhoneState Listener to listen changes such as CALL_STATE_IDLE , CALL_STATE_RINGING ,CALL_ STATE_ OFFHOOK. on receiving call to my BroacastReceiver for incoming/outgoing call. Most of the time things work properly. But sometimes my application does not receive events of Phone State Listener and hence it is not able to change/clear UI.From user feedback this typically occurs on HTC Hero. But I have came across this issue sometime on other devices also.My first guess is that android is killing my application in midway during call due to memory requirement. If so, is there any way to ensure that android does not my kill application under such situation .

View 1 Replies View Related

Android :: Cannot Find A Function That Deletes / Drops A Database

Mar 25, 2009

I have an automated test that creates a SQLite database. In the setup of the test I want to drop the database if it already exists. The problem is that I cannot find a function that deletes/drops a database. That seems like an odd omission. Help?

View 7 Replies View Related

Android : Way To Save Data On SD Card Always Deletes On Re-install?

Jul 30, 2010

I am using the getExternalFilesDir(null) method to save to the SD card. Saving and reading from the SD card is fine. The problem I am having is that every time I edit anything in Eclipse and rerun the app the data on the SD card is deleted. I know that saving to the directory returned by getExternalFilesDir(null) will allow the files there to be deleted when my app is uninstalled but is there a way to turn it off for just app updating? Is this only cause I am doing it from Eclipse and it won't delete the data when the app is updated from the market?

View 3 Replies View Related

Android :: Application Installer Tells That My App Reads Phone State And Identity

Apr 18, 2010

I have a simple app with a surfaceview nothing special one would say. However when installing on my phone I get two warnings.
1 - Phone calls
- read phone state and identity
2 - Storage
- modify/delete SD card content.
My really is nothing more than a simple puzzle and I dont understand why I get these warnings.

View 2 Replies View Related

Android :: Eclipse Deletes Java Files On Build Of Project

Sep 21, 2010

I have an interesting problem. I pull down an android project from cvs, which works fine. Once Eclipse builds the project, my .java files are removed. XML files, pngs, everything else is fine. I seem to be left with just the package tree, but no source files. Any thoughts?

View 1 Replies View Related

Android :: Updating Our Applicatoin On The Market Deletes The Saved SharedPreferences

Mar 9, 2009

We have an online multiplayer game that saves some login information in the SharedPreferences. Our app is copy protected and everything was going really well until this weekend when we released an update for it. It seems that at least some of the people are having their SharedPreferences deleted when they updated too the new app. As you can imagine our users are furious because they're all loosing their profiles, and our ranking is dropping fast.

We've tried to reproduce this a hundreds ways but are unable. We're wondering if this could be related to installing a copy protected app over a copy protected app? Since that's the only situation we haven't tested and can't test.

View 8 Replies View Related

HTC Droid Eris :: Opening Forwarded Mail On Phone

May 27, 2010

I have several users at work who have the HTC Droid Eris. We allow our users to connect to our work email via IMAP. We have an issue where when a users receives forwarded email, they can't open it. It give them the option to save to the SD card, but when you click again on it, it still only gives you that option. I tried one of our users, who has the new incredible, and it works on his once he saves it to the sd card, it gives the option to open. Has anyone gotten this issue before, or is there a work around for it.

View 1 Replies View Related







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