简体   繁体   English

不可转换类型无法将 android.view.view 转换为 javafx.scene.web.webview

[英]Inconvertible type cannot cast android.view.view to javafx.scene.web.webview

i want to show my post in webview but i fatch error of "Inconvertible type cannot cast android.view.view to javafx.scene.web.webview" in android studio.我想在 webview 中显示我的帖子,但我在 android studio 中遇到了“不可转换类型无法将 android.view.view 转换为 javafx.scene.web.webview”的错误。 how can i solve it please help me.我该如何解决,请帮助我。

WPPostDetails.java WPPostDetails.java

package com.ejobbox.ejobbox;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.TextView;

import javafx.scene.web.WebView;

public class WPPostDetails extends AppCompatActivity {
    TextView title;
    WebView webView;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_postdetails);
        title=(TextView) findViewById(R.id.title);
        webView= (WebView) findViewById(R.id.postwebview);
        Intent i = getIntent();
        int position = i.getExtras().getInt("itemPosition");

        //title.setText(MainActivity.mListPost.get(position).getTitle().getRendered());
        Log.e("WpPostDetails","title is"+MainActivity.mListPost.get(position).getTitle().getRendered());

        webView.getSettings().setJavaScriptEnabled(true);

    }
}

在此处输入图片说明

You import a wrong WebView class.您导入了错误的WebView类。 Remove import javafx.scene.web.WebView;删除import javafx.scene.web.WebView; and add import android.webkit.WebView并添加import android.webkit.WebView

导入 android.webkit.WebView 而不是 javafx.scene.web.WebView;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不可转换的类型:无法将 'android.view.View' 转换为 'android.widget.EditText' - Inconvertible types: cannot cast 'android.view.View' to 'android.widget.EditText' 不可转换的类型:android.view.View 到 androidtutorial.project.nightclock.Classes.TextClock - Inconvertible type: android.view.View to androidtutorial.project.nightclock.Classes.TextClock 无法将类别转换为android.view.View $ OnClickListener - Class cannot be cast to android.view.View$OnClickListener Android Studio - 不可转换的类型无法将视图转换为我的活动 - Android Studio - Inconvertible types cannot cast View to my activity 如何修复“渲染期间引发的异常:android.view.View 无法转换为 android.view.ViewGroup” - how to fix “Exception raised during rendering: android.view.View cannot be cast to android.view.ViewGroup” java.lang.ClassCastException:android.view.View无法转换为android.view.ViewGroup - java.lang.ClassCastException: android.view.View cannot be cast to android.view.ViewGroup android.widget.Button无法转换为android.view.View $ OnKeyListener - android.widget.Button cannot be cast to android.view.View$OnKeyListener RuntimeException:无法启动活动(MainActivity无法转换为android.view.View $ OnClickListener) - RuntimeException: Unable to start activity(MainActivity cannot be cast to android.view.View$OnClickListener) 无法使用 Adapter 类中的 Transition 将 Int 转换为 android.view.View - Cannot cast Int to android.view.View using Transition in Adapter class 无法将“android.view.View”转换为“com.example.avivyaacobi.contactmanager.Button” - Cannot cast 'android.view.View' to 'com.example.avivyaacobi.contactmanager.Button'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM