私はフラグメントを使用します:
FragmentManager manager = getFragmentManager();
しかし、log cat に次のエラーが表示されます。
12-30 21:14:05.500: E/AndroidRuntime(395):
java.lang.NoSuchMethodError:my.com.daily.Sign_upActivity.getFragmentManager
私の活動は次のとおりです。
public class sign_upActivity extends Activity implements AlertPositiveListener{
public String fonts="BZar.ttf";
private EditText fname,lname,birthdate,worktitle,company,username,pass,confpass,email,phone,phone1;
private Button signup;
private String gender;
private String education ,regiterDate,howIMF,expdate,active,picpath,deleted , expertise;
private RadioGroup radioGenderGroup;
private RadioButton radioGenderButton;
private Drawable error_indicator;
int position = 0;
int position1 = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sign_up);
OnClickListener listener = new OnClickListener() {
@Override
public void onClick(View v) {
FragmentManager manager = getFragmentManager();
AlertDialogRadio alert = new AlertDialogRadio();
Bundle b = new Bundle();
b.putInt("position", position);
alert.setArguments(b);
alert.show(manager, "alert_dialog_radio");
}
};
Button btn = (Button) findViewById(R.id.education_btn);
btn.setOnClickListener(listener);
}
@Override
public void onPositiveClick(int position) {
this.position = position;
TextView tv1 = (TextView) findViewById(R.id.education_tv);
tv1.setText(Education.code[this.position]);
education = Education.code[this.position];
}
}
誰が理由を教えてもらえますか?
ありがとうございます。私の問題はエミュレータで解決しましたが、電話で強制終了しました! minSdkVersion="4" を使用します