Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. package com.test.abc.activity;
  2. import com.test.abc.xx.R;
  3. import android.annotation.SuppressLint;
  4. import android.app.Activity;
  5. import android.content.Context;
  6. import android.os.Bundle;
  7. import android.view.View;
  8. import android.view.inputmethod.InputMethodManager;
  9. import android.webkit.WebView;
  10. import android.webkit.WebViewClient;
  11.  
  12. public class GoChatActivity extends Activity {
  13.  
  14. @SuppressLint("SetJavaScriptEnabled")
  15. public void onCreate(Bundle savedInstanceState) {
  16. super.onCreate(savedInstanceState);
  17. setContentView(R.layout.reg);
  18. WebView webView = (WebView) findViewById(R.id.webView1);
  19. webView.getSettings().setJavaScriptEnabled(true);
  20. webView.setWebViewClient(new WebViewClient());
  21. webView.loadUrl("http://dev.openflex.net/candy/");
  22. webView.requestFocus(View.FOCUS_DOWN);
  23. InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
  24. mgr.showSoftInput(webView, InputMethodManager.SHOW_IMPLICIT);
  25.  
  26.  
  27.  
  28.  
  29. }
  30.  
  31.  
  32. }
  33.  
  34. <?xml version="1.0" encoding="utf-8"?>
  35. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  36. android:layout_width="fill_parent"
  37. android:layout_height="fill_parent"
  38. android:orientation="vertical" >
  39.  
  40. <TextView
  41. android:layout_width="match_parent"
  42. android:layout_height="46dip"
  43. android:background="@drawable/skin_header_bar_bg"
  44. android:ellipsize="end"
  45. android:gravity="center"
  46. android:singleLine="true"
  47. android:text="Chat Room"
  48. android:textColor="@color/skin_bar_text"
  49. android:textSize="19.0sp" />
  50.  
  51. <com.test.abc.scrollview.BounceScrollView
  52. android:id="@+id/scrollView"
  53. android:layout_width="fill_parent"
  54. android:layout_height="fill_parent"
  55. android:background="@drawable/coversation_bg"
  56. android:fadingEdge="none"
  57. android:fillViewport="true"
  58. android:scrollbarThumbVertical="@drawable/scrollbar_handle_vertical" >
  59.  
  60. <WebView xmlns:android="http://schemas.android.com/apk/res/android"
  61. android:id="@+id/webView1"
  62. android:layout_width="fill_parent"
  63. android:layout_height="fill_parent"
  64. />
  65.  
  66. </com.test.abc.scrollview.BounceScrollView>
  67.  
  68. </LinearLayout>
  69.  
  70. <activity
  71. android:name="com.test.abc.activity.GoChatActivity"
  72. android:alwaysRetainTaskState="true"
  73. android:configChanges="locale|keyboardHidden|orientation|screenSize"
  74. android:exported="true"
  75. android:windowSoftInputMode="stateVisible"
  76. android:hardwareAccelerated="true"
  77. android:launchMode="singleTop"
  78. android:theme="@style/Default.SwipeBack.NoTitleBar"
  79. >
  80. </activity>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement