Permalink
Browse files

Avoid NPE

  • Loading branch information...
1 parent f7ce059 commit 8e0777a84dd65209cc73377b588a829092f01ae3 @lexs lexs committed Jun 28, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 facebook/src/com/facebook/android/FbDialog.java
@@ -47,6 +47,7 @@
import com.facebook.android.Facebook.DialogListener;
public class FbDialog extends Dialog {
+ private static final boolean SHOW_CLOSE_BUTTON = false;
static final int FB_BLUE = 0xFF6D84B4;
static final float[] DIMENSIONS_DIFF_LANDSCAPE = {20, 60};
@@ -82,8 +83,7 @@ protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
mContent = new FrameLayout(getContext());
- boolean shouldCreateCrossImage = false;
- if(shouldCreateCrossImage) {
+ if(SHOW_CLOSE_BUTTON) {
/* Create the 'x' image, but don't add to the mContent layout yet
* at this point, we only need to know its drawable width and height
* to place the webview
@@ -301,7 +301,10 @@ public void onPageFinished(WebView view, String url) {
*/
mContent.setBackgroundColor(Color.TRANSPARENT);
mWebView.setVisibility(View.VISIBLE);
- mCrossImage.setVisibility(View.VISIBLE);
+
+ if (SHOW_CLOSE_BUTTON) {
+ mCrossImage.setVisibility(View.VISIBLE);
+ }
}
catch(Exception e) {
e.printStackTrace();

0 comments on commit 8e0777a

Please sign in to comment.