0

I need help because I implemented a navigation drawer , but I need this load a FragmentActivity

@Override
public void onNavigationDrawerItemSelected(int position) {
    Fragment objFragment = null;
    switch (position) {
        case 0:
            //startActivity(new Intent(this, MainActivity.class));
            break;
        case 1:
            //startActivity(new Intent(this, MainActivity.class));
            break;
        case 2:
           // objFragment = new menu3_Fragment();
            break;
    }
}

public class MainActivity extends FragmentActivity {

I need to load the MainActivity in a fragment.

cramopy
  • 3,459
  • 6
  • 28
  • 42
Denisplata
  • 21
  • 4
  • Have you tried `getActivity()` ? – mewa Jun 02 '15 at 09:45
  • I need load the Fragment Activity in th fragment. If i start the activity with the startActivity works , but what I want is to keep the navigationdrawer – Denisplata Jun 02 '15 at 09:55
  • You need to either convert your activities to fragments and embed them or clone the ui to those activities – mewa Jun 02 '15 at 09:57
  • I have other activities to fragments , the question is that the Main handling other fragments . – Denisplata Jun 02 '15 at 10:01
  • I understand I have to have a single fragment , in this case the navigation drawer i then load the fragments in this – Denisplata Jun 02 '15 at 10:11
  • I solved, i implented public class MainActivity extends FragmentActivity implements NavigationDrawerFragment.NavigationDrawerCallbacks{ – Denisplata Jun 02 '15 at 10:38

0 Answers0