@ m0sがコメントで指摘したように:Textviewが初期化されていることを確認してください:
textview = new WebView(this); // used inside an Activity
また、簡単に区別できるように、最初の文字を大文字にするクラス名(WebView)と最初の文字を小文字にするインスタンス(textview)を記述するのはJavaの習慣です。
アップデート:
この行がnullを返す場合:
Textview = (WebView)this.findViewById(R.id.testview)
その後、あなたはおそらく電話するのを忘れました:
setContentView(R.layout.main);
あなたのactivity.onCreate()
方法で。findViewById(int)のjavadocは次のように述べています。
Finds a view that was identified by the id attribute from the XML THAT WAS
PROCESSED in onCreate(Bundle).
それが何をするかsetContentView()
(レイアウトXMLを処理する):
Set the activity content from a layout resource. The resource will be inflated,
adding all top-level views to the activity.