Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.test.abc.activity;
- import com.test.abc.xx.R;
- import android.annotation.SuppressLint;
- import android.app.Activity;
- import android.content.Context;
- import android.os.Bundle;
- import android.view.View;
- import android.view.inputmethod.InputMethodManager;
- import android.webkit.WebView;
- import android.webkit.WebViewClient;
- public class GoChatActivity extends Activity {
- @SuppressLint("SetJavaScriptEnabled")
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.reg);
- WebView webView = (WebView) findViewById(R.id.webView1);
- webView.getSettings().setJavaScriptEnabled(true);
- webView.setWebViewClient(new WebViewClient());
- webView.loadUrl("http://dev.openflex.net/candy/");
- webView.requestFocus(View.FOCUS_DOWN);
- InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
- mgr.showSoftInput(webView, InputMethodManager.SHOW_IMPLICIT);
- }
- }
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
- <TextView
- android:layout_width="match_parent"
- android:layout_height="46dip"
- android:background="@drawable/skin_header_bar_bg"
- android:ellipsize="end"
- android:gravity="center"
- android:singleLine="true"
- android:text="Chat Room"
- android:textColor="@color/skin_bar_text"
- android:textSize="19.0sp" />
- <com.test.abc.scrollview.BounceScrollView
- android:id="@+id/scrollView"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="@drawable/coversation_bg"
- android:fadingEdge="none"
- android:fillViewport="true"
- android:scrollbarThumbVertical="@drawable/scrollbar_handle_vertical" >
- <WebView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/webView1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- />
- </com.test.abc.scrollview.BounceScrollView>
- </LinearLayout>
- <activity
- android:name="com.test.abc.activity.GoChatActivity"
- android:alwaysRetainTaskState="true"
- android:configChanges="locale|keyboardHidden|orientation|screenSize"
- android:exported="true"
- android:windowSoftInputMode="stateVisible"
- android:hardwareAccelerated="true"
- android:launchMode="singleTop"
- android:theme="@style/Default.SwipeBack.NoTitleBar"
- >
- </activity>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement