delight-im / Android-AdvancedWebView

Enhanced WebView component for Android that works as intended out of the box
MIT License
2.39k stars 573 forks source link

Loading Twitter Page Problem #63

Closed mtuygun closed 8 years ago

mtuygun commented 8 years ago

When i tried to load twitter page. The tweets does't seem in page. You can only see headers!

ocram commented 8 years ago

Thanks for your report!

Please tell us the following:

mtuygun commented 8 years ago

. Android version 5.1 and next versions. . Url I tried to load is https://mobile.twitter.com/ Thanks in advance.

ocram commented 8 years ago

Thanks!

  1. Did you update the Android System WebView app to the latest version?
  2. Can you post a screenshot that shows the problem?
  3. Did you enable JavaScript in the WebView?
mtuygun commented 8 years ago

Thanks,

  1. Yes I have update Android system webview.
  2. https://play.google.com/store/apps/details?id=tr.com.socialmedia this is my apps url. I couldn't post screenshot.
  3. Yes I have enabled javascript.

Thanks in advance.

mtuygun commented 8 years ago

You can see the screenshot. I can't see the tweets. screenshot_2016-07-11-00-20-21

ocram commented 8 years ago

Thanks!

So regarding JavaScript, you have something like

myWebView.getSettings().setJavaScriptEnabled(true);

in your code, or at least not

myWebView.getSettings().setJavaScriptEnabled(false);

to disable it? It should be enabled by default and working, unless you explicitly disabled it.

Regarding Android System WebView, that means if you open "Play Store" on the device where you're testing your app, the "System WebView" app will be up-to-date? Can you double-check this?

What happens when you view that Twitter page in the original WebView instead of the extended version from this library?

mtuygun commented 8 years ago

Thanks, I have used webview.init(getApplicationContext()); code in init procedure there is already javascriptEnable(true), you can see below. webSettings.setAllowFileAccess(false); setAllowAccessFromFileUrls(webSettings, false); webSettings.setBuiltInZoomControls(false); webSettings.setJavaScriptEnabled(true); webSettings.setDomStorageEnabled(true);

when I use the original webview. I can see yhe tweets but as older theme. screenshot_smartselect_2016-07-13-09-34-46

mtuygun commented 8 years ago

I also realized that linkedin page can't loading... only white blank page :(

ocram commented 8 years ago

That's strange. But let's debug it:

  1. Please create a minimum working example for this bug. Remember to make a backup of your source code before, of course. Then remove as much code as possible until (almost) only the im.delight.android.webview.AdvancedWebView view in the layout is there and the myWebView = (AdvancedWebView) findViewById(R.id.webview); line and the mWebView.loadUrl(...) call in the Java code.
  2. Do the problems with Twitter and LinkedIn still occur with that minimum working example?
  3. Please share the code of your minimum working example.
  4. Please switch between this library and the original WebView while changing as few lines as possible. That is, you should probably have to change the reference in the layout and the class cast in the Java code only.
  5. Do the problems still occur with the code switched to use the original WebView?
  6. Please share the code for this updated example as well.

After that, we'll know. Thank you!

mtuygun commented 8 years ago

Thanks for all. It's all about not the webview. It's all about about webview's settings below: android:layout_width="match_parent" android:layout_height="match_parent"

it was android:layout_width="fill_parent" android:layout_height="fill_parent"

Thanks for all support.

ocram commented 8 years ago

No problem!

Are you really sure it was the android:layout_width and android:layout_height attributes?

Anyway, great to hear that it's working now.

mtuygun commented 8 years ago

Thanks for everything again. Yes it's really weird.