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; import android.view.View.OnTouchListener; import android.widget.FrameLayout; import org.ntlab.radishforandroidstudio.R; import org.ntlab.radishforandroidstudio.framework.gameMain.RealTime3DFragment; public class SampleActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample); //初期Fragmentの設定 Fragment fragment; fragment = new StartFragment(); getSupportFragmentManager().beginTransaction().replace(R.id.fragment_field,fragment).commit(); // 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); // //// //// SampleGameFragment samplegamefragment = new SampleGameFragment(); //// //// 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(); //// } // // // }