Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActivityGroup is Deprecated

I am making android application containing three tabs.. On third tab there is login screen..

when i click on login button ...i want to replace the activity with activity containing list view and logout button....

Previously i was using Activity Group to replace the activity..But activity Group is now deprecated..

Now how can i replace the activity under third tab??

I am using these code

Intent intent = new Intent(MyApp.this, LoginPage.class);

                    replaceContentVieww("activity4", intent);



  public void replaceContentVieww(String id, Intent newIntent) {
                    // TODO Auto-generated method stub


View view = getLocalActivityManager().startActivity(id,newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView(); 
                            setContentView(view);


                    }

There is link from which i came to know this class has been deprecated.

like image 996
Gopesh Gupta Avatar asked Oct 10 '22 21:10

Gopesh Gupta


1 Answers

you should use Fragment and FragmentManager in the Compatibility Package

http://developer.android.com/sdk/compatibility-library.html

download it using the ADT, then go to the samples here extras/android/compatibility/v4/samples/

like image 193
Mahdi Hijazi Avatar answered Oct 12 '22 13:10

Mahdi Hijazi