How to specify parameters used in XML, in code instead?

by hc » Tue, 08 Sep 2009 10:45:24 GMT

Sponsored Links
 I'm trying to do part of my Activity layout in code rather than XML,
but I realize not all the parameters are available in code. For

with HorizontalScrollView, there are

corresponding setter methods are not available in code,
unlike android:background that has setBackgroundResource

I'm hoping there's something similar to addRule in LayoutParams, where
I specify the parameter as the first argument, and the value as the
second argument.


Other Threads

1. How to update album art in MediaStore?

 I want to update the cover image of an album with one downloaded from

 I have the new path of the new image file(the image is already saved on my
sdcard) but i can't figure how to update the album art..

Thank yout!


2. Problem on getting SOAP response

I want to call the webservice method ,where have to pass the three parameter

But on soap response i am getting a Exception called as "System web service
Protocols SOAP exception" server did no get response And "faultcode   soap
client " faultstring
here the code is
public class Main extends Activity {
    private static final String SOAP_ACTION = "";
    private static final String METHOD_NAME = "GetHomePageRecos";
    private static final String NAMESPACE = "";
    private static final String URL = "";
    private Object resultRequestSOAP = null;
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        TextView tv = new TextView(this);

        Log.i("Comies","im the lay");
        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
        // Add Property
        request.addProperty("vcountry", "1");
        request.addProperty("vrecorPerPage", "5");
        request.addProperty("vrpageNo", "1");
        SoapSerializationEnvelope envelope = new
        // .Net
        envelope.dotNet = true;

        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);, envelope);

        resultRequestSOAP =  envelope.getResponse();
        String[] results = (String[])  resultRequestSOAP;

        tv.setText( results[0]);
        // Display Results in log (adb.exe logcat)
        catch(Exception e){


3. ROAMING on Android, has anyone ever worked with it???

4. coonection between MediaRecorder and PVMediaRecorder

5. Android Linux version number, other questions!

6. Problems With webview and UTF-8

7. USB driver doesn't work with Xperia 10