Skip to content

Commit

Permalink
Avoid NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
lexs committed Jun 28, 2012
1 parent f7ce059 commit 8e0777a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions facebook/src/com/facebook/android/FbDialog.java
Expand Up @@ -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};
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 8e0777a

Please sign in to comment.