this finish(); not resolve the situation coz i want call another activity
with back button so how i do that and the home button keep crash the
application

On Thu, Feb 23, 2012 at 3:58 PM, ravi . <ravikanth...@gmail.com> wrote:

> use this code
>
> @Override
>  public void onBackPressed()
>  {
>    finish();
>    }
>
> On Feb 23, 6:45 pm, Live Happy <livehap...@gmail.com> wrote:
> > I'm using the sample Google provides, FragmentTabsPager to work with tabs
> > in my application. and i add the method onbackpress to return to the
> first
> > activity but this method crashed my application when i press the back
> > button or also the home button that i didn't override it
> >
> >  @Override
> >   public void onBackPressed()
> >   {
> >          //call intent
> >     Intent i = new Intent(this,home.class);
> >     startActivity(i);
> >     finish();
> >
> > }
> >
> > it return Null pointer exception at the method onSaveInstanceState
> >
> > so can anyone help with it thx for answer
>

-- 
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

Reply via email to