it\'s possible to pass a context variable to a DialogFragment?
i\'ve use this code inside dialog for passing a string:
public static ConfirmDialog newIns
use like this:
public class Dialog extends DialogFragment implements OnClickListener {
public void onClick(View v) {
switch (v.getId()) {
case R.id.message: {
this.startActivity(new Intent(context, Login.class));
//or use getActivity() instead of context
}
break;
}
}
@Override
public void onAttach(Activity activity) {
// TODO Auto-generated method stub
super.onAttach(activity);
context=activity;
}
}