Android 如何将版面或webview内容发送到其他活动?

Android 如何将版面或webview内容发送到其他活动?,android,android-layout,android-intent,android-webview,Android,Android Layout,Android Intent,Android Webview,我的项目中有两项活动。在我的第一个活动中,我有一个按钮,布局名称是m\u MyWebView。在我的布局文件夹中,我有webviewlayout,我可以在我的m_MyWebView布局中设置它。我希望,单击按钮后,其他活动将被打开(这不是问题),我在“撰写”版面中的另一个WebView将获得类似webviewlayout的内容。但我不知道,你怎么能故意这么做。因为我无法发送带有意图的内容 这是我的密码: 我的ForwardReplyActivity类: public class ForwardR

我的项目中有两项活动。在我的第一个活动中,我有一个按钮,布局名称是
m\u MyWebView
。在我的布局文件夹中,我有webviewlayout,我可以在我的
m_MyWebView
布局中设置它。我希望,单击按钮后,其他活动将被打开(这不是问题),我在“撰写”版面中的另一个
WebView
将获得类似webviewlayout的内容。但我不知道,你怎么能故意这么做。因为我无法发送带有意图的内容

这是我的密码:

我的ForwardReplyActivity类:

public class ForwardReplyActivity extends Activity {

    private ImageButton m_Reply;
    private WebView webview;
    private LinearLayout m_MyWebView;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        m_MyWebView = (LinearLayout) findViewById(R.id.MyWebViewL);
        View view = getLayoutInflater().inflate(R.layout.webviewlayout,
                m_MyWebView, false);
        WebView wb = (WebView) view.findViewById(R.id.WebViewim);

        //wb.getSettings().setJavaScriptEnabled(true);
        wb.loadDataWithBaseURL(null,
                "bla bla bla", "text/html", "UTF-8",
                null);

        m_MyWebView.addView(view);
        m_Reply = (ImageButton) findViewById(R.id.imageButton1);

        m_Reply.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View view) {
                Intent intent = new Intent(ForwardReplyActivity.this,
                        Compose.class);

            }
        });
    }

}
还有我的写作课:

public class Compose extends Activity {

    private WebView webview;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.compose);

        webview = (WebView) findViewById(R.id.webView1);

    }

我从你的问题中了解到的是,你想使用一些数据从一个活动到另一个活动


因此,您需要
putExtras
符合您的意图。

谢谢您的回复,但我知道将使用putExtras,但我无法将其用于webview的内容。.您需要什么类型的内容,webview的状态?提到它,这将有助于理解你的问题。