Monday, January 7, 2013

Re: [android-developers] Get Problems with Google Map V2 SupportMapFragment in a Viewpage

Hi Mark,

thanks for your post. i know that Fragment_Map needs to inherit from FragmentActivity. what i want is a viewpage with 2 fragments which i can swipe between these 2 fragments. one of the fragments shows only a picture. the another one should show the GoogleMap. when i want to use a viewpage i have the classes FragmentActivity, FragmentPagerAdapter and Fragment. that means i have to write a fragment, which initialize the map and so on... therefore i can not write it in a fragment, it gives an error. the FragmentActivity looks like

public class MainActivity extends FragmentActivity {

    SectionsPagerAdapter mSectionsPagerAdapter;

    /**
     * The {@link ViewPager} that will host the section contents.
     */
    ViewPager mViewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        // Create the adapter that will return a fragment for each of the three
        // primary sections of the app.
        mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

        // Set up the ViewPager with the sections adapter.
        mViewPager = (ViewPager) findViewById(R.id.pager);
        mViewPager.setAdapter(mSectionsPagerAdapter);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
}


do you mean, i have to write the methods in this class? i
've already tried an got an error.
can u give me plz a suggestion? 
i do not know what to do now. :(

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment