android - webview is not present in xml layout file but still getting its reference in class file -


protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     getwindow().requestfeature(window.feature_action_bar);     getactionbar().hide();     setcontentview(r.layout.activity_main);     webview = (webview) findviewbyid(r.id.webview1);     deviceid = secure.getstring(this.getcontentresolver(),             secure.android_id);     //toast.maketext(this, deviceid, toast.length_long).show();     webview.getsettings().setjavascriptenabled(true); //  webview.getsettings().setbuiltinzoomcontrols(true);     checkconnection2();     pd = new progressdialog(mainactivity.this);     pd.setmessage("loading");     pd.show(); 

above class file..

and below xml layout file-

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:paddingbottom="@dimen/activity_vertical_margin"     android:paddingleft="@dimen/activity_horizontal_margin"     android:paddingright="@dimen/activity_horizontal_margin"     android:paddingtop="@dimen/activity_vertical_margin"     tools:context="com.ycsin.medianewsone.mainactivity" >   </relativelayout> 

note- have copied project similar project

the project working fine changes. can please tell me reason behind bbug..


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -