Skip to content

Commit

Permalink
[Android] Fix the issue that date picker is not work
Browse files Browse the repository at this point in the history
In the patch crosswalk-project#3857(decouple XWalkView from the activity), we need
use WindowAndroid instead of ActivityWindowAndroid as the top window
of XWalkView, but that will prevent DateTimeChooserAndroid activity
to to launched.

Here we create WindowAndroid or ActivityWindowAndroid according to
the context type.

BUG=XWALK-7269
  • Loading branch information
xzhan96 committed Sep 26, 2016
1 parent cf78ba3 commit cc0a8fd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.navigation_controller.UserAgentOverrideOption;
import org.chromium.media.MediaPlayerBridge;
import org.chromium.ui.base.ActivityWindowAndroid;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.ui.gfx.DeviceDisplayInfo;
import org.json.JSONArray;
Expand Down Expand Up @@ -137,8 +138,9 @@ public XWalkContent(Context context, String animatable, XWalkViewInternal xwView
mContentsClientBridge);
mIoThreadClient = new XWalkIoThreadClientImpl();

// Initialize mWindow which is needed by content
mWindow = new WindowAndroid(context);
// Initialize mWindow which is needed by content.
mWindow = WindowAndroid.activityFromContext(context) != null ?
new ActivityWindowAndroid(context) : new WindowAndroid(context);

SharedPreferences sharedPreferences = new InMemorySharedPreferences();
mGeolocationPermissions = new XWalkGeolocationPermissions(sharedPreferences);
Expand Down

0 comments on commit cc0a8fd

Please sign in to comment.