Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1013339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:05:08+00:00 2026-05-16T10:05:08+00:00

Having another issue, and this one is BAFFLING! Here we go. We have a

  • 0

Having another issue, and this one is BAFFLING!

Here we go.

We have a layout…

<?xml version="1.0" encoding="utf-8"?>
<!-- Template for creating a result in MediaUpload -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    <LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:isScrollContainer="true"
      android:focusableInTouchMode="false"
      android:focusable="false">
      <ImageView android:id="@+id/imgView" 
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:maxWidth="110dp"
      android:maxHeight="110dp"
      android:minWidth="110dp"
      android:minHeight="110dp"
      android:layout_gravity="center_vertical"
      android:padding="3dp"
      android:scaleType="center"
      android:clickable="true"
      android:focusable="true"
      android:focusableInTouchMode="true"
      android:saveEnabled="true"/>
      <LinearLayout 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:gravity="center_horizontal">
        <TextView android:id="@+id/img_file_name" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/LinkText"
        android:textStyle="bold"
        android:paddingBottom="3dp"/>
        <EditText android:id="@+id/img_title" 
        android:hint="Title"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:minWidth="150dp"
        android:maxHeight="50dp"
        android:inputType="textVisiblePassword"
        android:maxLength="255"/>
        <EditText android:id="@+id/img_desc" 
        android:hint="Description"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:minWidth="150dp"
        android:maxHeight="50dp"
        android:maxLength="255"/>
      </LinearLayout>
    </LinearLayout>
    <ImageView
      android:src="@drawable/divider"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:scaleType="fitXY"
      android:paddingTop="2dp"
      android:paddingBottom="2dp">
    </ImageView>
</LinearLayout>

We’re using this here as a template for an object that a user can upload to our site.
(This is in a massive layout, so just posting what we’re appending it to).

<LinearLayout android:id="@+id/list_of_images"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
</LinearLayout>

Soo…Here’s the actual issue. When a user selects an image from their gallery, it adds correctly to our LinearLayout. Now, one of our workers has low memory issues all the time, and the app is closed while he takes pictures or browses. Our app is set up to save all the data (data being the Uri, Title text, Description text, etc) immediately before the user leaves the app into the savedInstanceState method.

/*
     * The Activity is being recycled and needs to have its instance
     * saved before we lost all of the image URis!
     */
    protected void onSaveInstanceState(Bundle outState)
    {
        super.onSaveInstanceState(outState);
        helper.saveEnteredData();
        outState.putParcelableArray(IMAGE_URI_BUNDLE_KEY, helper.getUploadObjectArray());
        outState.putParcelable(CAPTURE_IMAGE_URI_BUNDLE_KEY, currentFileURI);

        outState.putInt(CURRENT_JOB_BUNDLE_KEY, reportSpinner.getSelectedItemPosition());

        ArrayList<ReportInfoParcelable> alReps = new ArrayList<ReportInfoParcelable>();
        for(int i = 0; i < reportList.length; ++i)
            alReps.add(new ReportInfoParcelable(reportList[i]));

        outState.putParcelableArray(JOB_LIST_BUNDLE_KEY, alReps.toArray(new ReportInfoParcelable[alReps.size()]));
    }

Here is the helper.saveEnteredData()…

public void saveEnteredData()
    {
        ViewGroup vg = null;
        UploadObject object = null;
        String title, desc;
        for(int i = 0; i < mLinearLayout.getChildCount(); i++)
        {
            vg = (ViewGroup) mLinearLayout.getChildAt(i);
            object = alUploadObjects.get(i);
            title = ((TextView) vg.findViewById(R.id.img_title)).getText().toString();
            desc = ((TextView) vg.findViewById(R.id.img_desc)).getText().toString();
            object.setTitle(title);
            object.setDesc(desc);
        }
    }

When the app returns from a crash after the user left the activity, when we debug through the app on return, the array of UploadObjects that return contain all the correct Uri’s, titles, and descriptions, but when the app finally displays, ALL editTexts on the LinearLayout we append to, all suddenly contain the title and description of the last UploadObject in the Parcelable array. Again, we debug through each appending of the objects, and the objects contain the correct data. We are baffled and need some help here!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:05:08+00:00Added an answer on May 16, 2026 at 10:05 am

    We got it!

    Not totally sure what is going on here, but we overrode(sp?) the method onPostCreate(Bundle) and parsed out the bundle here instead and our problem is fixed. There must be something about inflating an xml file during an onCreate() which messes something up.

    Anyway, if you have to inflate an XML (other than your regular layout), do it onPostCreate()!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue with backbone.js' models. I have a view that creates another
Having another tough one here guys, basically I would like to check if a
We have been having this issue pop up sporadically, but now I can reproduce
I'm having another iOS related issue. This time relating to addSubView on a UIView.
I'm having an issue with an expanding div tag that is nested within another
As many of you may already know I have been having issues with another
I am still having issues copying the part of one array to another. I
We are having another discussion here at work about using parametrized sql queries in
I am having a real issue with the EF v1. I have quite a
I'm having a weird issue with my Silverlight 4 project, although it's one I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.