package com.example.testfragment2;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.Menu;
import android.view.animation.Transformation;
public class MainActivity extends FragmentActivity {
@ Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.activity_main);
/ / This line of code has been changed to an error in the parent application class object can not point to FragMent myFragment = new FragMentA ();
/ / Error transation add went on to say myFragment error method if the Fragment object type I am speechless What is this billing ah
Fragment myFragment = new FragMentA ();
/ / FragmentManager manager = this.getSupportFragmentManager ();
/ / FragmentTransaction transation = manager.beginTransaction ();
/ / Transation.add (R.id.fragment_container, myFragment);
this.getSupportFragmentManager () beginTransaction () add (R.id.fragment_container, myFragment);..
}
@ Override
public boolean onCreateOptionsMenu (Menu menu) {
getMenuInflater () inflate (R.menu.activity_main, menu);.
return true;
}
}
Reply:
Perversion of the reform package back
Reply:
I have given, where the package guide wrong?
No comments:
Post a Comment