Hi All,

Same problem I am facing for my application.   I want to refresh my previous
activity on back button.
I am having an activity containing next and previous button.  On clicking
next and previous button I am calling the same activity itself but with
different content.
Now, If I am calling this activity by startActivity() in onResume() method,
the problem what coming is that if I click on back button (Phone) it goes to
the onResume method of this activity and calling this activity again.  So,
everytime I am pressing back button, it is calling the same activity itself
and never goes back to the home screen.
The same problem is occurring with on key back method.

I am not sure how to do this.  I tried various Intent flags also but of no
use for e.g. FLAG_ACTIVITY_CLEAR_TOP, FLAG_ACTIVITY_SINGLE_TOP and
FLAG_ACTIVITY_NO_HISTORY

Any help in this regard would be highly appreciated as I need this on urgent
basis.

Thanks!!

On Tue, Mar 22, 2011 at 5:28 PM, Filip Havlicek <[email protected]>wrote:

> Hi Ranveer,
>
> maybe refreshing the contents in the history Activity's onResume() method
> would be sufficient for your needs.
>
> Best regards,
> Filip Havlicek
>
> 2011/3/22 harsh chandel <[email protected]>
>
>> @Override
>>    public boolean onKeyDown(int keyCode, KeyEvent event) {
>>        if (keyCode == KeyEvent.KEYCODE_BACK) {
>>                //Intent intent = new Intent(this,name of the class where
>> you
>> want to go to);
>>
>>                startActivity(intent);
>>
>>                return true;
>>        }
>>        return super.onKeyDown(keyCode, event);
>>    }
>>
>> this code captures the event on back button click
>>
>> On Mar 22, 8:49 am, Ranveer <[email protected]> wrote:
>> > Dear all,
>> >
>> > I want to reload the previous activity (history) on back button click.
>> > Right now When I am pressing back (Phone) it going to previous activity
>> > but showing from history.
>> > So every time I click back I want to reload the history page.
>> >
>> > regards
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> 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 post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to