diff --git a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/tests/SampleActivity.java b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/tests/SampleActivity.java index 6c0c69d..babc0a2 100644 --- a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/tests/SampleActivity.java +++ b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/tests/SampleActivity.java @@ -1,6 +1,8 @@ package org.ntlab.radishforandroidstudio.cactusClient.tests; import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; @@ -16,6 +18,29 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample); + + + Fragment fragment; + if (savedInstanceState == null) { +// FragmentManager manager = getSupportFragmentManager(); +// FragmentTransaction transaction = manager.beginTransaction(); +// +// transaction.add(R.id.container, new SampleGameFragment()); +// +// transaction.commit(); + +// fragment = new StartFragment(); + fragment = new StartFragment(); + getSupportFragmentManager() + .beginTransaction() + .replace(R.id.fragment_field, fragment) + .commit(); + } + + + } +} + //touch event用 // frameLayout01 = (FrameLayout)findViewById(R.id.framelayout_sample); // frameLayout01.setOnTouchListener((SampleGameFragment)samplgem); @@ -26,30 +51,27 @@ //// View view1 =(View)findViewById(R.id.framelayout_sample); //// view1.setOnTouchListener((SampleGameFragment)samplegamefragment); - } - public void ClickButton(View view){ - Fragment fragment; - - if(view == findViewById(R.id.button)){ - fragment = new StartFragment(); - getSupportFragmentManager() - .beginTransaction() - .replace(R.id.fragment_field, fragment) - .commit(); - } - - if(view == findViewById(R.id.button2)){ - fragment = new SampleGameFragment(); - getSupportFragmentManager() - .beginTransaction() - .replace(R.id.fragment_field, fragment) - .commit(); - } - - - } - - -} +// +// public void ClickButton(View view){ +// Fragment fragment; +// +//// if(view == findViewById(R.id.button)){ +//// fragment = new StartFragment(); +//// getSupportFragmentManager() +//// .beginTransaction() +//// .replace(R.id.fragment_field, fragment) +//// .commit(); +//// } +// +//// if(view == findViewById(R.id.button2)){ +// fragment = new SampleGameFragment(); +// getSupportFragmentManager() +// .beginTransaction() +// .replace(R.id.fragment_field, fragment) +// .commit(); +//// } +// +// +// }