android – Refresh fragment when dialogfragment is dismissed-ThrowExceptions

Exception or error: Is there any way I can detect when a DialogFragment is dismissed, so that i can update its parent fragment? How to solve: You can add a listener and override the onDismiss of your fragment dialog : public class DismissDialog extends DialogFragment { private DialogInterface.OnDismissListener onDismissListener; public void setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) { this.onDismissListener …

android – Null FragmentTransaction being passed to TabListener.onTabSelected()-ThrowExceptions

Exception or error: I’m adding navigation tabs to an action bar using the sample code provided here: http://developer.android.com/guide/topics/ui/actionbar.html I’m using ActionBarSherlock. My TabListener is copied directly from the docs. public static class TabListener<T extends Fragment> implements ActionBar.TabListener { private Fragment mFragment; private final Activity mActivity; private final String mTag; private final Class<T> mClass; /** Constructor …

java – How to disable back button pressed in android fragment class-ThrowExceptions

Exception or error: I want to disable the back button in a fragment class. onBackPressed() doesn’t seem to work in this fragment. How could I disable the back button? This is my sample code: public class Login extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, ,Bundle savedInstanceState) { ViewGroup root = (ViewGroup) inflater.inflate(R.layout.login, null); …

android – Bitmap not drawn anti-aliased-ThrowExceptions

Exception or error: I have a custom View that always draws a Bitmap at a certain rotation. I overwrite the onDraw method, rotate the Canvas and draw the bitmap with an anti-aliased Paint. public RotatedImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); someBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.placeholder); } @Override protected void onDraw(Canvas canvas) { …

android – Callback When DialogFragment is Dismissed-ThrowExceptions

Exception or error: I want to launch a dialog with a custom layout, which I’ve implemented via a DialogFragment. (I basically just changed onCreateView() and added button handlers). The dialog lets the user quickly change an important setting. This dialog will be launched from several different activities. The different activities don’t have much in common, …