How to get the WebView UserAgent (without having a Context)

by Mariano Kamp » Wed, 16 Dec 2009 03:16:19 GMT


Sponsored Links
 That's exactly the point why I try to store ApplicationContexts, but those
don't work in this case.





>



Other Threads

1. salam kenal dan tanya dikit...

salam kenal, saya pengguna baru android... baru kemaren dapet motorola cliq.
mohon info link atau tutor dll yang bisa bikin ini cliq jadi keren....
oiya kenapa gak pernah bisa login YM dari icon IM bawaan motorola yak?

salam,

Imam Maulana

-- 
"Indonesian Android Community [id-android]" 

2. Display a Dialog in non-Activity (simple Java) Class By passing Parameters

Hi,
     I am trying to display a dialog box in a simple Java class that is
called from my main Activity but not successful.
Please help me to figure it out.

I am passing the required values as parametrs.


I have two class:

class MainActivity extends Activity  ::  Main *starting point *of
Application

class ShowMyDialog   ::      a simple java program In which I *generate an
URl* and *display a dialog with WebView*.
                                          I am passing the Acitivity from my
MainActivity to this class as a parameter in function.

But I am *unable to call* the onCreateDialog method that I have *defined in
the simple java class*.

However , If I define the *onCreateDialog method in MainActivity*, I am able
to display it* successfully.
*

*What Should I pass as Parameter to the non Activity class from MainActivity
class so that I am able to display the dialog as defined by showdialog
method in JAVA class ???*

My steps of source code is as follow:


class MainActivity extends Activity{

  onCreate{

            Activity passingActivity =  this;        //  THIS PASSING
PARAMETERS NEED TO BE CHANGED , getApplicationContext doesnot works for me
           ShowMyDialog showMyDialog = new ShowMyDialog(passingActivity);
           showMyDailog.displayMyDialog();

   }
}


class ShowMyDialog{

       public ShowMyDialog(Activity passingActivity){
            this.passingActivity = passingActivity;
       }


        public displayMyDialog (){
             int ID = 1;

            passingActivity.showdialog(ID);
        }

    protected Dialog onCreateDialog(int position){

             Dialog dialog = new Dialog(callingActivity);
             dialog.setContentView(R.layout.dialogbrowser);
             WebView mWebView = (WebView) dialog.findViewById(R.id.webview);
             mWebView.loadUrl("http://www.google.com");
             return dialog
   }

}

Thanks,
NIshant

-- 

3. Using SyncAdapter for syncing application data

4. How to change background of activity and background of the application name at the top of your activity

5. Poor roaming performance ! Is it an Android bug ?

6. Disable scaling of ImageView

7. Can I send an image byte[] to ACTION_VIEW intent?