Refresh button, out of tabhost

by satie » Wed, 05 Jan 2011 03:46:00 GMT

Sponsored Links

here you are my problem.
When user click "refresh" in OptionsMenu, disappear Tabhost and the
use the simple webbrowser out of app.
I'd like to use OptionMenu "refresh" inside tab host.
My code:
public class app extends TabActivity {

        public void onCreate(Bundle savedInstanceState) {


                TabHost host=getTabHost();
                Intent i=new Intent(this, CWBrowser.class);

                i.putExtra(CWBrowser.URL, "" ;);

                //to update tab each time it pressed

                i=new Intent(i);
                i.putExtra(CWBrowser.URL, " ");

        public boolean onCreateOptionsMenu(Menu menu){
                Intent i=new Intent(this, CWBrowser.class);
                i.putExtra(CWBrowser.URL, "" ;);

                //We create the first group of MenuItem
                int GROUPA = 0;
                menu.add(GROUPA, 0, 0, "Refresh").setIntent(i);
                return true;


AND CWBrowser
public class CWBrowser extends Activity {
        public static final String URL="";
        private WebView browser;

        public void onCreate(Bundle icicle) {

                browser=new WebView(this);
        browser.setWebViewClient(new HelloWebViewClient());


        private class HelloWebViewClient extends WebViewClient {
        public boolean shouldOverrideUrlLoading(WebView view, String
url) {
            return true;


Other Threads

1. How to copy contacts in phone to another account ?

When your SyncAdapter is initialized by the system you should get a
flag in the Bundle you receive from the SyncManager.

So if this flag is present, copy the contacts to your account.


2. ThreadSafeConnectionManager timeout...

Hi !
I'm actually trying to do an application with a websocket persistent
connexion & some http request. So I thank I need to use
ThreadSafeConnectionManager, but I have a big problem with it : very
very often I got a " The operation timed out"
even when the server's responding.
My code :
// class members declarations
private static HttpParams mParams;
private static SchemeRegistry mSchemeRegistry;
private static ClientConnectionManager mCm;
private static HttpClient mClient;

// code used to initiate the HttpClient
mParams = new BasicHttpParams();
mSchemeRegistry = new SchemeRegistry();
mSchemeRegistry.register(new Scheme("http",
PlainSocketFactory.getSocketFactory(), 80));
mCm = new ThreadSafeClientConnManager(mParams, mSchemeRegistry);
mClient = new DefaultHttpClient(mCm, mParams);

What am I doing wrong?
Thanks a lot.
Louis C.


3. Android MediaPlayer cannot play VoD stream from VLC server


5. [beginner] Analysis of the engadget app

6. about KeyStore

7. Problem konek internet Samsung Galaxy 5