エラーが発生します
show(FragmentManager, String)
型のメソッドDialogFragment
は引数に適用できません(FragmentManager, String)
package com.example.test1;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentActivity;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void click(View view) {
DialogFragment newFragment = new FireMissilesDialogFragment();
newFragment.show(getFragmentManager(), "missiles");
}
public boolean onCreateOtionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}