Hi

I have a view layout as bellow. It has an EditText input box and a
scroll text (TextView) window. After the testShell activity is
started, it will bind to a service. The service is simply accept the
EditText input and send back to the TextView. If I start the testShell
then exit, the testShell will bind to the Service and then unbind to
the Service. The view works OK. But if I start the Service manually
from another activity, then start the testShell, the testShell will do
the samething, bind to the service. However, when I exit the testShell
and comeback again, it seems the previous EditText and TextView are
still exist and are not freed. When I type in the command from the
current EditText window, it sends the text to the previous TextView
which are not visiable to the current window. Can someone help me why
the previous views (TextView and EditText) are not freed when bind to
the existing Service?

thanks,

// scrollbar.xml
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:gravity="bottom">

        <ScrollView
        android:id="@+id/scrollview"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1">

        <TextView
        android:id="@+id/shellview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
    </ScrollView>

        <EditText android:id="@+id/cmdText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>
</LinearLayout>

public class testShell extends Activity implements OnClickListener,
OnKeyListener{
        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);

                setContentView(R.layout.scrollbar);
                sv=(ScrollView) findViewById(R.id.scrollview);
                mTextview = (TextView) findViewById(R.id.shellview);
                mCmdview = (EditText) findViewById (R.id.cmdText);


                initView();

                //TextView textview = new TextView(this);
                mTextview.setText("This is the testShell Tab\r\n");
                doBindService();
        }

        @Override
        protected void onDestroy() {
                super.onDestroy();
                doUnbindService();

        }

              // some handling codes here

}

-- 
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

Reply via email to