我想在我的webview中打开twitter auth而不是在浏览器中打开,任何好的教程如何在对话框中使用webview并将其加载到对话框中?
您只需将对话框主题应用于包含WebView的常规活动即可.
Context mContext = this; AlertDialog.Builder alert = new AlertDialog.Builder(mContext); alert.setTitle("Riga"); WebView wv = new WebView(mContext); String html = "some html here"; wv.loadData(html, "text/html", "UTF-8"); alert.setView(wv); alert.setIcon(R.drawable.icon); alert.setPositiveButton("Yes", new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int id){ Toast.makeText(getApplicationContext(), "Success", Toast.LENGTH_SHORT).show(); } }); alert.setNegativeButton("No", new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int id){ Toast.makeText(getApplicationContext(), "Fail", Toast.LENGTH_SHORT).show(); } }); alert.show();