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
example

with HorizontalScrollView, there are
android:scrollbarSize
android:scrollbarTrackHorizontal
android:scrollbarThumbHorizontal

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.

Thanks
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How to update album art in MediaStore?

Hi!
 I want to update the cover image of an album with one downloaded from
internet.

 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 = "
http://115.108.40.174/hionstockws/service1.asmx/GetHomePageRecos";
    private static final String METHOD_NAME = "GetHomePageRecos";
    private static final String NAMESPACE = "
http://115.108.40.174/hionstockws";
    private static final String URL = "
http://115.108.40.174/hionstockws/service1.asmx";
    private Object resultRequestSOAP = null;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView tv = new TextView(this);
        setContentView(tv);

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

        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        androidHttpTransport.call(SOAP_ACTION, envelope);

        resultRequestSOAP =  envelope.getResponse();
        String[] results = (String[])  resultRequestSOAP;
        Log.i("Result",results.toString());


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

-- 

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