Hi,

I am trying to work with SignalR and the only way I could do that is by 
using a WebView. The Webview will only be used to maintain communication 
with my server so there is no visual use of this.

I am trying to use a WebView with visibility = gone so that it will be 
hidden all the time. The problem is that when I user the loadUrl method it 
opens a new window with the Browser device.

How can I avoid this. How can I use a WebView just to run some javascripts. 
Below is my layout and onCreate method:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffe3d0">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Demo: WebView"
android:layout_gravity="center" style="@style/MainLabel" android:autoText=
"false" android:id="@id/mainLabel"
android:textColor="#3c3f41"/>
<WebView
android:layout_width="fill_parent"
android:layout_height="30dp"
android:id="@id/webView" android:visibility="gone"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/secondTextView"
android:id="@+id/textView" android:textColor="#1635ff" 
android:layout_gravity="center"/>
</LinearLayout>


@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

WebView webview = (WebView) findViewById(R.id.webView);

WebSettings webSettings = webview.getSettings();
webSettings.setJavaScriptEnabled(true);

webview.loadUrl("http://google.com/";); 
} 


Can you help me please.
Thanks in advance 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to