private Button btnLogin;
private EditText txtPub;
private EditText txtPriv;
final Context context = this;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.loginfirst);
btnLogin = (Button)findViewById(R.id.btnEnter);
btnLogin.setOnClickListener(this);
txtPub = (EditText)findViewById(R.id.textPublic);
txtPriv = (EditText)findViewById(R.id.textPrivate);
}
@Override
public void onClick(View arg0) {
Intent intent = new Intent(context, WebViewActivity.class);
startActivity(intent);
}
在 WebViewActivity.class
private WebView webView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
webView = (WebView) findViewById(R.id.web_view);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://url.com/txtpub+txtprive");
}
如何获取 edittxt txtpub 和 txtpriv 的值并将 webviewactivity 类放在上面的 url 中?我想将 txtpub 和 txtpriv 的值放在 url 中。请帮帮我