Hello.
There was a strange problem. I'm trying to load html, but no WebView
(link null
).
Calling an Activity
from WebView
:
Intent intent = new Intent(); intent.setClass(this, aboutProg.class); startActivity(intent);
onCreate
Activity
onCreate
Method
private String uriFile = "file:///android_asset/"; private WebView wv; public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.about_programm); wv = (WebView)this.findViewById(R.id.textAboutUsWeb);//в том месте не находит wv.loadUrl(uriFile+"textAboutUs.html");//а тут вылетает, потому что wv - null }
And about_programm.xml file
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#fff"> <WebView android:id="@+id/textAboutUsWeb" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </RelativeLayout>
Shl. This problem occurs on tablets with android 3.2 and 2.3 . On phones with android 2.3 works.
(wv.loadUrl(uriFile+"textAboutUs.html")
, but for example the text. There may be problems with paths or rights. - evgeniy