Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed Webview in Android Fragment no longer works in cordova 4.0 #1

Open
twilly86 opened this issue May 27, 2015 · 11 comments
Open

Embed Webview in Android Fragment no longer works in cordova 4.0 #1

twilly86 opened this issue May 27, 2015 · 11 comments
Assignees

Comments

@twilly86
Copy link

Embed Webview in Android Fragment sample code no longer works for android 4.0.

See error details here...

http://stackoverflow.com/questions/30489176/cordova-webview-inside-android-fragment-on-cordova-4-0

@arumsey
Copy link
Member

arumsey commented Jun 23, 2015

Thanks for bringing up the issue @twilly86. I will look into updating this sample to support Cordova 4.0.

@arumsey arumsey self-assigned this Jun 23, 2015
@teamnorge
Copy link

In case you need a bigger stack trace:
android.view.InflateException: Binary XML file line #14: Class is not a View

org.apache.cordova.CordovaWebView
at android.view.LayoutInflater.createView(LayoutInflater.java:604)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at info.geometrixx.webview.HomeFragment.onCreateView(HomeFragment.java:63)
...

Caused by: java.lang.ClassCastException: org.apache.cordova.CordovaWebView cannot be cast to android.view.View
at java.lang.Class.asSubclass(Class.java:1380)
at android.view.LayoutInflater.createView(LayoutInflater.java:552)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at info.geometrixx.webview.HomeFragment.onCreateView(HomeFragment.java:63)

@0x524A4B
Copy link

0x524A4B commented Sep 9, 2015

Is this project still being supported?

@arumsey
Copy link
Member

arumsey commented Sep 9, 2015

Hi @runjumpkick - Yes it is. The Android code however needs a major re-write in order to support the latest Cordova libs.

@0x524A4B
Copy link

OK. Is there a ETA on publishing a modernized sample app?

@wayneforrest
Copy link

I am also experiencing the same problem, when can we expect an update?

@twilly86
Copy link
Author

Check out this post, it should get you pointed in the right direction.

http://stackoverflow.com/questions/30489176/cordova-webview-inside-android-fragment-on-cordova-4-0

@wayneforrest
Copy link

Thanks; I tweaked the code you mentioned above and got the Cordova webView showing.

Can you perhaps share your CordovaContext.java file?

  @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {


        //???what is CordovaContext ???
        //LayoutInflater localInflater = inflater.cloneInContext(new CordovaContext(getActivity(), this));

        //my hack
        View v = inflater.inflate(R.layout.webview_cordova, container, false);

@galacticappster04
Copy link

I am so tired with this JavaScript/HTML5/CSS being forced into a native app. Maybe we should stop forcing ourselves writing codes that are meant only for browsers. Just fixing this things alone isn't cost and time effective. I am moving away from this web apps thingy from now on.

@bpetriv
Copy link

bpetriv commented Mar 9, 2016

@twilly86 I am working on Apache Cordova team at Microsoft. Our team is interested in understanding your experiences with embedded Cordova web views. Would you be able to fill in this quick contact info survey http://www.instant.ly/s/WGx9L so that we can get in touch with you?

arumsey added a commit that referenced this issue May 5, 2016
…#1

- full refactor of the sample to support lattest Android SDK, AEM mobile 6.2 and Cordova 4.0
- added bottom button bar
- added gradle build
- introduced material design
- added custom plugin
@arumsey
Copy link
Member

arumsey commented May 5, 2016

I finally freed up some time in my schedule to update this app. Thanks for the help @twilly86.

arumsey added a commit that referenced this issue May 5, 2016
Updated to reflect changes made to support Issue #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants