Monday, 12 August 2013

Android show single item from a list in next page

Android show single item from a list in next page

I am new to android and developing a mail like application. In the
application, from a JSON string from server creating a list ( creating
rows in a table view, which is embedded in a scroll view ). Now I am
trying to show a single item in detail on clicking an item.
On click, getting the id of the corresponding item and load new page using
the following page. My code looks like
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
Bundle b = new Bundle();
b.putInt("id", 124);
b.putInt("message", "Message");
intent.putExtras(b);
startActivity(intent);
finish();
But my problem is the listing page get cleared on return back from that page.
ie, on click delete button in the child page, I want to delete the same
item in the list page also. But after I deleted the item from the child
page, using this code to redirect to the parent page.
Intent intent = new Intent(SecondActivity.this, FirstActivity.class);
Bundle b = new Bundle();
b.putInt("id", 124);
intent.putExtras(b);
startActivity(intent);
finish();
How to delete the single item with out page refresh if coming from the
child view and load the fresh page if coming directly.
Thank you for your time Please help Thanks in advance

No comments:

Post a Comment