[android-developers] post data not re-submitted on webview back in 4.4.4

2014-09-09 Thread Jay Howard
Anyone run into this?

Activity creates a WebView and sets cache mode = LOAD_NO_CACHE, then calls 
WebView.postUrl() with a URL and some POST data.

The resulting webpage has a hyperlink, which the user tap to access a 
second page.

He then taps the device back button, which I intercept and turn into a 
goBack() call on the WebView.

On a 4.2.2 device this results in the original POST request being re-sent 
along with the original data supplied to WebView.postUrl().

On a 4.4.4 device the device still makes a POST request, but without the 
POST data.

Verified this is this case by way of server logs.

-- 
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, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Using android:action to launch activity from settings

2014-09-09 Thread Subodh Nijsure
I have defined my settings.xml file to include an item that uses
android:action item in the setting dialog. See the sample code for
that activity below.

It all works fine. However this thing is overlaying my entire
activity and when user presses back button my entire application
finishes. Is there a way to launch a Fragment using android:action
in settings.xml or how I can restructure my activity so when that
activity finishes my main activity is resumed?

PreferenceScreen
Preference android:title=Current User 
intent android:action=com.example.coreui.ShowCurrentUserActivity
/
/Preference
/PreferenceScreen

here is the activity code

public class ShowCurrentUserActivity extends Activity {
public  AlertDialog dialog = null;
@Override
public void onCreate(Bundle savedInstanceState) {
String msgStr;
super.onCreate(savedInstanceState);
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setPositiveButton(Logout,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
ShowCurrentUserActivity.this.finish();
}
});
alert.setNegativeButton(Dismiss,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
ShowCurrentUserActivity.this.finish();
}
});
}
}

This is how I specify activity in my AndroidManifest.xml

activity
android:name=com.example.coreui.ShowCurrentUserActivity
android:label=CurrentUser
android:exported=false
 intent-filter
action android:name=com.example.coreui.ShowCurrentUserActivity /
category android:name=android.intent.category.DEFAULT /
/intent-filter
/activity

-- 
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, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Tracking down multiple Activity instances in memory

2014-09-09 Thread Nathan
I'm fairly sure I have been able to use the eclipse tools before to track 
down memory leaks - I even found one in Google Analytics. 

But I can't for the life of me figure out.

I have found out that there are two instances of Activity B in memory when 
the activity is closed. I can see that with 

I know enough to know that that is bad. 

But what I cannot see is WHY. Why is that stupid activity still in memory 
twice?

I seem to remember that I right click on something and choose Merge Path to 
GC Roots. 

Then I get something like this. 


Class 
Name
   
| Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
---
com.android.internal.policy.impl.PhoneLayoutInflater @ 0x42d2b0d8 
Unknown|1 |   40 
|   536 |64
'- mPrivateFactory, mContext MyActivity @ 0x42d28230|1 
|  536 |   536 |   127,336
class com.android.internal.os.ZygoteInit @ 0x41a21a18 System 
Class   |1 |  120 
|   536 | 1,000
'- mResources android.content.res.Resources @ 
0x41aa7108 |1 
|  112 |   536 | 8,512
   '- mContext android.app.ContextImpl @ 
0x43009398  |1 
|  128 |   536 |10,400
  '- mOuterContext MyActivity @ 0x42d4f008  |1 
|  536 |   536 | 3,864
---

Well that PhoneLayoutInflater shouldn't be holding on to that context of a 
closed activity, but I don't think I control that. 
And definitely that ZygoteInit thing shouldn't be holding a context in a 
static way, but I don't control that either. 

Any tips on finding the causes better?

Nathan


Nathan

-- 
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, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.