A packet becomes null if it is passed into sub-activity

I use the standard Android Intent / Bundle method to transfer data into sub-activity.

The problem is that although the intent looks good before the action begins, it displays as a zero value in the sub-activity. I can not find anyone else who had this problem, so I thought that I would ask to indicate where to look / how to debug.

(Target - Android 2.1)

Fragment of parental activity:

@Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        super.onListItemClick(l, v, position, id);

        Intent i = new Intent(ctx, ArticleView.class);

        i.putExtra("url", articles.get(position).url.toString());
        // The following line correctly logs the URL
        Log.d(TAG,"Starting article viewer with url " + i.getStringExtra("url"));

        startActivityForResult(i,ACTIVITY_ARTICLE);
    }

Children's activity fragment:

@Override
protected void onCreate(Bundle icicle) {

    super.onCreate(icicle);
    setContentView(R.layout.article_view);

    if (icicle != null) {
        // Never called!
    } else {
        // Always called
        Log.d(TAG,"Icicle is null - no URL passed in");
    }

}

Ignoring the fact that icicle is null and trying to get status information from it (using getString), a hang occurs and:

03-14 22:23:03.529: WARN/ActivityManager(52): Activity HistoryRecord{44ddd238 com.t.s/.ArticlesList} being finished, but not in LRU list

Any hints were greatly appreciated.

+3
source share
2 answers

, ( ).

Intent intent = getIntent();

, , , , . . - , , .

+3

OnCreate() Bundle

Bundle b = getIntent().getExtras();
+1

All Articles