In my code attached, I am trying to use two Android WebViews (webView1 and webView2) to display a javaScript enabled menu inside webView1 and a page showing the result of menu-click triggered in webView1 inside webView2.
As the code show, I am dynamically trying to fit the WebViews dynamically to the target screen by calculating my own initial scales and then plug the computed scales into the WebViews during Run-time.
Here is the problem I would like to ask for your assistance... When I click on the menu items in webView1 in order to show the result in webView2, extra horizontal white spaces (size of the horizontal white spaces are about the same width of the target screen, but the horizontal scroll bar is about the witdh of webView2) are shown in webView2. The white spaces appears randomly (i.e. The white spaces somtimes appears sometimes not).
I have tried adding function calls to clear the WebViews cache. The horiztonal white spaces appears less frequently in webView2, but the problem still persists.
It is interesting to know that this only happen in Android 4.0+ devices and does not happen in devices whose OS is Android 3 and below. We have tested this using Samsung Galaxy Notes II and Samsung Galaxy Tab 10.1 for Android 4 devices. We tested on Huawei Ideos U8150 for Android 2.2 device and a no brand device for Android 3 device.
I have set the minimum SDK target to API 8 and the maximum SDK target to API 15 when compiling the Android project.
I have already done extensive research on this problem in the Internet (including in StackOverflow) for 2 days, but I could not find any post similar to my problem's context.
I would like to know how to remove the horizontal white spaces in webView2. Please assists.
Thanks.
Please see code listing below:
package com.xyz.XyzPkg;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import android.os.AsyncTask;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ScrollView;
import android.graphics.Bitmap;
public class OpenxyzActivitiesActivity extends Activity implements OnClickListener {
private final static int ID_BTNBACK = 987654321;
private final static int ID_BTNACTIVITY_UI1 = 999977777;
private final static int ID_BTNACTIVITY_UI2 = 999977776;
WebView webView1;
WebView webView2;
protected String TAG = OpenxyzActivitiesActivity.class.getSimpleName();
ImageButton btnBack;
int screenwidth = 0;
float fOrigWidth1 = 0.0f; //180.0f;
float fOrigWidth2 = 0.0f; //300.0f;
float fWeightSum = 0.0f;
float fWeight1 = 0.0f;
float fWeight2 = 0.0f;
float fWindowWidth = 0.0f;
float fWindowHeight = 0.0f;
float fWindowDensity = 0.0f;
float fInitScale1 = 0.0f;
float fInitScale2 = 0.0f;
int fViewportSize1 = 0;
int fViewportSize2 = 0;
int delta = 0;
boolean bChosenWidth = false;
String sUrlBase = "http://test.xyz.com/parents";
LinearLayout LinearLayout1;
ImageButton btnActivityUI1;
ImageButton btnActivityUI2;
FrameLayout frameLayout0;
LinearLayout LinearLayout4;
final int ID_WEBVIEW1 = 987654321;
@SuppressLint("SetJavaScriptEnabled")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
webView1 = new WebView(this);
webView1.setId(ID_WEBVIEW1);
webView1.getSettings().setJavaScriptEnabled(true);
webView2 = new WebView(this);
//new InitTask().execute(new String[]{sUrlBase + "/activities/sendActvtData.php"});
new InitTask().execute(new String[]{sUrlBase + "/activities/sendActvtData.php"});
}
//public class InitThread implements Runnable{
private class InitTask extends AsyncTask<String, Void, ArrayList<Float> >{
@Override
protected void onPostExecute(ArrayList<Float> result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
frameLayout0 = new FrameLayout(getApplicationContext());
LinearLayout.LayoutParams oFrameLayout0Params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
frameLayout0.setLayoutParams(oFrameLayout0Params);
LinearLayout LinearLayout0 = new LinearLayout(getApplicationContext());
LinearLayout0.setWeightSum(100.0f);
LinearLayout LinearLayout1 = new LinearLayout(getApplicationContext());
LinearLayout.LayoutParams oLinearLayout1Params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
LinearLayout1.setLayoutParams(oLinearLayout1Params);
LinearLayout1.setWeightSum(100.0f);
//BEGIN: Setting up Window Size -- Change Windows Size in UI Thread
LayoutParams oLayoutParams = (LayoutParams)LinearLayout1.getLayoutParams();
oLayoutParams.width = (int)fWindowWidth;
oLayoutParams.height = (int)fWindowHeight;
LinearLayout1.setLayoutParams(oLayoutParams);
LinearLayout linearLayoutDummyProduct = new LinearLayout(getApplicationContext());
android.widget.LinearLayout.LayoutParams linearLayoutDummyProductLayoutParams = new android.widget.LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
linearLayoutDummyProduct.setLayoutParams(linearLayoutDummyProductLayoutParams);
oLayoutParams = (LayoutParams)linearLayoutDummyProduct.getLayoutParams();
LinearLayout linearLayoutDummyProduct2 = new LinearLayout(getApplicationContext());
linearLayoutDummyProduct2.setLayoutParams(linearLayoutDummyProductLayoutParams);
oLayoutParams = (LayoutParams)linearLayoutDummyProduct2.getLayoutParams();
float fDummy1Weight = 0.0f;
float fFrameLayoutWeight = 0.0f;
if (bChosenWidth)
{
LinearLayout0.setOrientation(LinearLayout.VERTICAL);
fDummy1Weight = 100.0f*delta/fWindowHeight;
linearLayoutDummyProductLayoutParams = new android.widget.LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, fDummy1Weight);
fFrameLayoutWeight = 100.0f-2*fDummy1Weight;
oFrameLayout0Params = new android.widget.LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, fFrameLayoutWeight);
Log.d(TAG, "fDummy1Weight = 100.0f*delta/fWindowHeight;");
}
else{
LinearLayout0.setOrientation(LinearLayout.HORIZONTAL);
fDummy1Weight = 100.0f*delta/fWindowWidth;
linearLayoutDummyProductLayoutParams = new android.widget.LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, fDummy1Weight);
fFrameLayoutWeight = 100.0f-2*fDummy1Weight;
oFrameLayout0Params = new android.widget.LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, fFrameLayoutWeight);
Log.d(TAG, "fDummy1Weight = 100.0f*delta/fWindowWidth;");
}
Log.d(TAG, "fDummy1Weight = " + fDummy1Weight);
Log.d(TAG, "fFrameLayoutWeight = " + fFrameLayoutWeight);
linearLayoutDummyProduct.setLayoutParams(linearLayoutDummyProductLayoutParams);
linearLayoutDummyProduct2.setLayoutParams(linearLayoutDummyProductLayoutParams);
frameLayout0.setLayoutParams(oFrameLayout0Params);
//END: Setting up Window Size
float fWeightSum = LinearLayout1.getWeightSum();
float fWidthSum = fOrigWidth1 + fOrigWidth2;
fWeight1 = fOrigWidth1 / fWidthSum * fWeightSum;
fWeight2 = fOrigWidth2 / fWidthSum * fWeightSum;
fViewportSize1 = screenwidth * (int)fOrigWidth1 / (int)(fOrigWidth1+fOrigWidth2);
fViewportSize2 = screenwidth * (int)fOrigWidth2 / (int)(fOrigWidth1+fOrigWidth2);
Log.d(TAG, "onPostExecute: fViewportSize1=" + fViewportSize1);
Log.d(TAG, "onPostExecute: fViewportSize2=" + fViewportSize2);
android.widget.LinearLayout.LayoutParams oLinearLayoutParams1 = new android.widget.LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, fWeight1);
android.widget.LinearLayout.LayoutParams oLinearLayoutParams2 = new android.widget.LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, fWeight2);
webView1.setLayoutParams(oLinearLayoutParams1);
webView2.setLayoutParams(oLinearLayoutParams2);
oLinearLayoutParams1 = (android.widget.LinearLayout.LayoutParams)webView1.getLayoutParams();
oLinearLayoutParams2 = (android.widget.LinearLayout.LayoutParams)webView2.getLayoutParams();
webView2.getSettings().setUseWideViewPort(false);
LinearLayout1.addView(webView1);
LinearLayout1.addView(webView2);
Log.d(TAG, "onPostExecute: fWeightSum=" + fWeightSum);
Log.d(TAG, "onPostExecute: fWidthSum=" + fWidthSum);
Log.d(TAG, "onPostExecute: oLinearLayoutParams1.weight=" + oLinearLayoutParams1.weight);
Log.d(TAG, "onPostExecute: oLinearLayoutParams2.weight=" + oLinearLayoutParams2.weight);
webView1.setInitialScale((int)fInitScale1);
webView2.setInitialScale((int)fInitScale2);
webView1.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView2.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView1.setPersistentDrawingCache(ViewGroup.PERSISTENT_NO_CACHE);
webView1.clearCache(true);
webView1.clearHistory();
webView1.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
//webView1.loadUrl(sUrlBase + "/activities/?lang=en");
String sWebView1Url = sUrlBase + "/activities/?lang=en&viewport_width="+fViewportSize1 + "&viewport_initial_scale=" + fInitScale1*0.01f;
webView1.loadUrl(sWebView1Url);
Log.d(TAG, "onPostExecute(): sWebView1Url: " + sWebView1Url);
webView1.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url){
//webView1.stopLoading();
url = url + "&viewport_width=" + fViewportSize2 + "&viewport_initial_scale=" + fInitScale2*0.01f;
Log.d(TAG, "setWebViewClient: CHK000: url: " + url);
if (view.getId() == ID_WEBVIEW1)
{
Log.d(TAG, "ID_WEBVIEW1: " + ID_WEBVIEW1);
Log.d(TAG, "WebView1 stopped loading");
//view.stopLoading();
webView1.setPersistentDrawingCache(ViewGroup.PERSISTENT_NO_CACHE);
webView1.clearCache(true);
webView1.clearHistory();
webView2.setPersistentDrawingCache(ViewGroup.PERSISTENT_NO_CACHE);
webView2.clearView();
webView2.clearCache(true);
webView2.clearHistory();
Map<String, String> noCacheHeaders = new HashMap<String, String>(2);
noCacheHeaders.put("Pragma", "no-cache");
noCacheHeaders.put("Cache-Control", "no-cache");
// webView2.getSettings().setAppCacheMaxSize(0);
// webView2.getSettings().setAppCacheEnabled(false);
webView2.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
webView2.loadUrl(url, noCacheHeaders);
// webView2.loadUrl(url);
Log.d(TAG , "shouldOverrideUrlLoading(): fInitScale1: " + fInitScale1);
Log.d(TAG , "shouldOverrideUrlLoading(): fInitScale2: " + fInitScale2);
Log.d(TAG , "shouldOverrideUrlLoading(): webView1.getScale(): " + webView1.getScale());
Log.d(TAG , "shouldOverrideUrlLoading(): webView2.getScale(): " + webView2.getScale());
Log.d(TAG, "shouldOverrideUrlLoading(): ((LinearLayout.LayoutParams)webView2.getLayoutParams()).weight: " + ((LinearLayout.LayoutParams)webView2.getLayoutParams()).weight);
Log.d(TAG , "shouldOverrideUrlLoading(): url: " + url);
webView1.setInitialScale((int)fInitScale1);
webView2.setInitialScale((int)fInitScale2);
}
else
{
Log.d(TAG, "Other Web View triggered shouldOverrideUrlLoading");
}
return true;
}
});
webView2.setPersistentDrawingCache(ViewGroup.PERSISTENT_NO_CACHE);
webView2.clearView();
webView2.clearCache(true);
webView2.clearHistory();
// Map<String, String> noCacheHeaders = new HashMap<String, String>(2);
// noCacheHeaders.put("Pragma", "no-cache");
// noCacheHeaders.put("Cache-Control", "no-cache");
// webView2.getSettings().setAppCacheMaxSize(0);
// webView2.getSettings().setAppCacheEnabled(false);
webView2.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
// webView2.loadUrl("http://parents.xyz.com/activities/?catg=coloring", noCacheHeaders);
//webView2.loadUrl(sUrlBase + "/activities/?catg=coloring");
webView2.loadUrl(sUrlBase + "/activities/?catg=coloring&viewport_width="+fViewportSize2 + "&viewport_initial_scale=" + fInitScale1*0.01f);
//webView2.getSettings().setTextSize(t)
frameLayout0.addView(LinearLayout1);
LinearLayout LinearLayout2 = new LinearLayout(getApplicationContext());
LinearLayout.LayoutParams oLinearLayout2Params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
LinearLayout2.setLayoutParams(oLinearLayout2Params);
LinearLayout2.setWeightSum(100.0f);
LinearLayout2.setOrientation(LinearLayout.HORIZONTAL);
frameLayout0.addView(LinearLayout2);
ImageView btnInvisible0 = new ImageView(getApplicationContext());
LinearLayout.LayoutParams btnInvisible0Params = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 90.0f);
btnInvisible0.setLayoutParams(btnInvisible0Params);
LinearLayout LinearLayout3 = new LinearLayout(getApplicationContext());
LinearLayout.LayoutParams oLinearLayout3Params = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 10.0f);
LinearLayout3.setLayoutParams(oLinearLayout3Params);
LinearLayout3.setWeightSum(100.0f);
LinearLayout3.setOrientation(LinearLayout.VERTICAL);
btnBack = new ImageButton(getApplicationContext());
btnBack.setId(ID_BTNBACK);
LinearLayout.LayoutParams btnBackParams = new LinearLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, 0, 18.0f);
btnBack.setLayoutParams(btnBackParams);
btnBack.setScaleType(ScaleType.FIT_XY);
btnBack.post(new Runnable(){
@Override
public void run() {
// TODO Auto-generated method stub
btnBack.setBackgroundDrawable((Drawable)getResources().getDrawable(R.drawable.btn_back));
}
});
btnBack.setOnClickListener(OpenxyzActivitiesActivity.this);
ImageView btnInvisible1 = new ImageView(getApplicationContext());
LinearLayout.LayoutParams btnInvisible1Params = new LinearLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, 0, 82.0f);
btnInvisible1.setLayoutParams(btnInvisible1Params);
LinearLayout4 = new LinearLayout(getApplicationContext());
LinearLayout.LayoutParams oLinearLayout4Params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
LinearLayout4.setLayoutParams(oLinearLayout4Params);
LinearLayout4.setWeightSum(100.0f);
LinearLayout4.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout4.setOnClickListener(OpenxyzActivitiesActivity.this);
frameLayout0.addView(LinearLayout4);
btnActivityUI1 = new ImageButton(getApplicationContext());
btnActivityUI1.setId(ID_BTNACTIVITY_UI1);
LinearLayout.LayoutParams btnActivityUI1Params = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 37.5f);
btnActivityUI1.setLayoutParams(btnActivityUI1Params);
btnActivityUI1.setScaleType(ScaleType.FIT_CENTER);
btnActivityUI1.post(new Runnable(){
@Override
public void run() {
// TODO Auto-generated method stub
btnActivityUI1.setImageDrawable((Drawable)getResources().getDrawable(R.drawable.activityui_300));
}
});
btnActivityUI1.setOnClickListener(OpenxyzActivitiesActivity.this);
btnActivityUI2 = new ImageButton(getApplicationContext());
btnActivityUI2.setId(ID_BTNACTIVITY_UI2);
LinearLayout.LayoutParams btnActivityUI2Params = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 62.5f);
btnActivityUI2.setLayoutParams(btnActivityUI2Params);
btnActivityUI2.setScaleType(ScaleType.FIT_CENTER);
btnActivityUI2.post(new Runnable(){
@Override
public void run() {
// TODO Auto-generated method stub
btnActivityUI2.setImageDrawable((Drawable)getResources().getDrawable(R.drawable.activityui_500));
}
});
btnActivityUI2.setOnClickListener(OpenxyzActivitiesActivity.this);
LinearLayout4.addView(btnActivityUI1);
LinearLayout4.addView(btnActivityUI2);
LinearLayout3.addView(btnBack);
LinearLayout3.addView(btnInvisible1);
LinearLayout2.addView(btnInvisible0);
LinearLayout2.addView(LinearLayout3);
LinearLayout0.addView(linearLayoutDummyProduct);
LinearLayout0.addView(frameLayout0);
LinearLayout0.addView(linearLayoutDummyProduct2);
setContentView(LinearLayout0);
}
@Override
protected ArrayList<Float> doInBackground(String... params) {
// TODO Auto-generated method stub
Log.d(InitTask.class.getSimpleName() , "params[0]: " + params[0]);
return callHttp(params[0]);
}
private ArrayList<Float> callHttp(String url) {
ArrayList<Float> alResult = new ArrayList<Float>();
//BEGIN HTTP Request...
//String url = "http://parents.xyz.com/activities/sendActvtData.php";
Log.d(InitTask.class.getSimpleName() , "url: " + url);
HttpClient httpclient = new DefaultHttpClient();
// Prepare a request object
HttpGet httpget = new HttpGet(url);
Log.d(TAG , "CHK000");
// Execute the request
HttpResponse response;
String result = "";
try {
Log.d(TAG , "CHK010");
response = httpclient.execute(httpget);
// Examine the response status
Log.d(TAG , "CHK020");
Log.i(TAG,response.getStatusLine().toString());
Log.d(TAG , "CHK030");
// Get hold of the response entity
HttpEntity entity = response.getEntity();
// If the response does not enclose an entity, there is no need
// to worry about connection release
Log.d(TAG , "Is entity null? " + ((entity == null)?"YES":"NO") );
Log.d(TAG , "CHK040");
if (entity != null) {
// A Simple JSON Response Read
InputStream instream = entity.getContent();
result= convertStreamToString(instream);
// now you have the string representation of the HTML request
instream.close();
}
Log.d(TAG , "CHK100");
}
catch (ClientProtocolException cpe){
Log.e(TAG , cpe.getMessage());
}
catch (IOException ioe){
Log.e(TAG , ioe.getMessage());
}
catch (Exception e) {
Log.d(TAG , "CHK EXP");
Log.d(TAG, e.toString());
}
//END HTTP Request...
Log.d(TAG, "http result: " + result);
String[] ActvData = result.split(",");
fOrigWidth1 = Float.parseFloat(ActvData[0]);
fOrigWidth2 = Float.parseFloat(ActvData[1]);
Log.d(TAG, "fOrigWidth1: " + fOrigWidth1);
Log.d(TAG, "fOrigWidth2: " + fOrigWidth2);
//BEGIN: Setting up Window Size -- Calculation
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
screenwidth = metrics.widthPixels;
int screenheight = metrics.heightPixels;
Log.d(TAG, "screenwidth: " + screenwidth);
Log.d(TAG, "screenheight: " + screenheight);
//800x480
float heightFactor = (float)screenheight / 480f;
float widthFactor = (float)screenwidth / 800f;
float chosenFactor = 1f;
bChosenWidth = false;
if (widthFactor < heightFactor)
{
bChosenWidth = true;
chosenFactor = widthFactor;
}
else
{
bChosenWidth = false;
chosenFactor = heightFactor;
}
int newHeight = (int)((float)480.0 * (float)chosenFactor);
int newWidth = (int)((float)800.0 * (float)chosenFactor);
Log.d(TAG, "heightFactor: " + heightFactor);
Log.d(TAG, "widthFactor: " + widthFactor);
Log.d(TAG, "newHeight: " + newHeight);
Log.d(TAG, "newWidth: " + newWidth);
delta = 0;
if (bChosenWidth)
{
delta = (screenheight - newHeight) / 2;
}
else{
delta = (screenwidth - newWidth) / 2;
}
Log.d(TAG, "delta: " + delta);
//END: Setting up Window Size -- Calculation
fWindowWidth = newWidth;
fWindowHeight = newHeight;
fWindowDensity = (float)metrics.density;
fWeight1 = fOrigWidth1;
fWeight2 = fOrigWidth2;
fWeightSum = fWeight1 + fWeight2;
Log.d(TAG , "fWeight1: " + fWeight1);
Log.d(TAG , "fWeight2: " + fWeight2);
fInitScale1 = 0.0f;
fInitScale2 = 0.0f;
fInitScale1 = fInitScale2 = fWindowWidth / fWeightSum * 100;
Log.d(TAG , "fWindowWidth: " + fWindowWidth);
Log.d(TAG , "fWindowHeight: " + fWindowHeight);
Log.d(TAG , "fWindowDensity: " + fWindowDensity);
Log.d(TAG , "fInitScale1: " + fInitScale1);
Log.d(TAG , "fInitScale2: " + fInitScale2);
Log.d(TAG , "CHK200");
return alResult;
}
private String convertStreamToString(InputStream is) {
/*
* To convert the InputStream to String we use the BufferedReader.readLine()
* method. We iterate until the BufferedReader return null which means
* there's no more data to read. Each line will appended to a StringBuilder
* and returned as String.
*/
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return sb.toString();
}
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch(v.getId()){
case ID_BTNBACK:
Intent myIntent = new Intent();
setResult(Activity.RESULT_OK, myIntent);
finish();
break;
case ID_BTNACTIVITY_UI1: case ID_BTNACTIVITY_UI2:
LinearLayout4.setClickable(false);
frameLayout0.removeView(LinearLayout4);
break;
}
}
}