[android-beginners] Re: Remote View setString

2009-10-02 Thread Paul Turchenko
You can set an attribute only before view's inflation. After view has been inflated, the only thing you can resort to is calling view's method that will change its state. Right now, methods offered by RemoteViews is the only way to communicate with widget. I think you can help us solve your

[android-beginners] Re: Remote View setString

2009-10-01 Thread Mark Murphy
Can some one please help me understand the setString function in RemoteViews? public void setString (int viewId, String methodName, String value) Can I pass any method name to setString ? I have a custom view in my xml layout file. I'm passing the view id of my custom view, name of a

[android-beginners] Re: Remote View setString

2009-10-01 Thread android learner
Thanks Mark. Yes it is my own view class (like a button). But it works fine in RemoteView as long as I do not attempt to set anything in my view class. But one of the parameters in this view class is dynamic and I need to set it from the Remote View (like we do a setText for a button). That is

[android-beginners] Re: Remote View setString

2009-10-01 Thread android learner
Let us keep aside the fact that I'm using a custom view. Consider a normal case, where I am using an existing Android view, for example AnalogClock class in my layout. Is there anyway I can call a public method of AnalogClock Class through the remote view? I need to dynamically update something

[android-beginners] Re: Remote View setString

2009-10-01 Thread Paul Turchenko
Yes, you can call a public method on widget's views via the remote views as long as it matches signature of 1 of methods that RemoteViews class offers. For example, to set text on the TextView that exists in widget's layout, you can use RemoteViews.setString(R.id.your_view_id, setText, your

[android-beginners] Re: Remote View setString

2009-10-01 Thread android learner
Thanks Paul. That was helpful. In my case, the public method I'm trying to call, does not match with the signature of any of the methods that RemoteView class offers. I guess that explains the error I get. Is there any way to overcome this limitation? Also, I'd like to know if there is any other