Android : DialogFragment edited show() method in Android

on Monday, September 1, 2014


I'm working with DialogFragments, I want change show(fragmentmanager,string) method with another parameters. I tried to implement new show method in dialogfragment class and call original show() methods with it but it giving exception.


MainActivity class is here;



public class MainActivity extends Activity implements CustomDialogMethods {
CustomDialog cd = new CustomDialog();
FragmentManager fm = getFragmentManager();


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void onClick(View v) {

cd.Editshow();

}


Editshow method calling in dialogfragment's edited show method,



public class CustomDialog extends DialogFragment {

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
bla..
bla..
bla..


return dialog;
}


public void Editshow(){

FragmentManager fm = getFragmentManager();

show(fm, "inform");
}


EditShow calling original show method here..


its giving error how can fix it?


Thanks..


0 comments:

Post a Comment